diff -pruN 20190101-1/conf-ar 20220801-1/conf-ar
--- 20190101-1/conf-ar	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/conf-ar	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1 @@
+ar
diff -pruN 20190101-1/crypto/crypto_hash_sha256.c 20220801-1/crypto/crypto_hash_sha256.c
--- 20190101-1/crypto/crypto_hash_sha256.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_hash_sha256.c	2022-07-17 07:30:14.000000000 +0000
@@ -82,7 +82,7 @@ static void blocks(crypto_uint32 *z, con
 
 
 
-int crypto_hash_sha256_tinynacl(unsigned char *o, const unsigned char *m, unsigned long long n) {
+int crypto_hash_sha256_tinyssh(unsigned char *o, const unsigned char *m, unsigned long long n) {
 
     long long i;
     unsigned char x[128];
diff -pruN 20190101-1/crypto/crypto_hash_sha256.h 20220801-1/crypto/crypto_hash_sha256.h
--- 20190101-1/crypto/crypto_hash_sha256.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_hash_sha256.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,12 +1,12 @@
 #ifndef crypto_hash_sha256_H
 #define crypto_hash_sha256_H
 
-#define crypto_hash_sha256_tinynacl_BYTES 32
-extern int crypto_hash_sha256_tinynacl(unsigned char *,const unsigned char *,unsigned long long);
+#define crypto_hash_sha256_tinyssh_BYTES 32
+extern int crypto_hash_sha256_tinyssh(unsigned char *,const unsigned char *,unsigned long long);
 
-#define crypto_hash_sha256 crypto_hash_sha256_tinynacl
-#define crypto_hash_sha256_BYTES crypto_hash_sha256_tinynacl_BYTES
-#define crypto_hash_sha256_IMPLEMENTATION "tinynacl"
+#define crypto_hash_sha256 crypto_hash_sha256_tinyssh
+#define crypto_hash_sha256_BYTES crypto_hash_sha256_tinyssh_BYTES
+#define crypto_hash_sha256_IMPLEMENTATION "tinyssh"
 #define crypto_hash_sha256_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/crypto_hash_sha512.c 20220801-1/crypto/crypto_hash_sha512.c
--- 20190101-1/crypto/crypto_hash_sha512.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_hash_sha512.c	2022-07-17 07:30:14.000000000 +0000
@@ -81,7 +81,7 @@ static void blocks(unsigned long long *z
     }
 }
 
-int crypto_hash_sha512_tinynacl(unsigned char *o,const unsigned char *m, unsigned long long n) {
+int crypto_hash_sha512_tinyssh(unsigned char *o,const unsigned char *m, unsigned long long n) {
 
     long long i;
     unsigned char x[256];
diff -pruN 20190101-1/crypto/crypto_hash_sha512.h 20220801-1/crypto/crypto_hash_sha512.h
--- 20190101-1/crypto/crypto_hash_sha512.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_hash_sha512.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,12 +1,12 @@
 #ifndef crypto_hash_sha512_H
 #define crypto_hash_sha512_H
 
-#define crypto_hash_sha512_tinynacl_BYTES 64
-extern int crypto_hash_sha512_tinynacl(unsigned char *, const unsigned char *, unsigned long long);
+#define crypto_hash_sha512_tinyssh_BYTES 64
+extern int crypto_hash_sha512_tinyssh(unsigned char *, const unsigned char *, unsigned long long);
 
-#define crypto_hash_sha512 crypto_hash_sha512_tinynacl
-#define crypto_hash_sha512_BYTES crypto_hash_sha512_tinynacl_BYTES
-#define crypto_hash_sha512_IMPLEMENTATION "tinynacl"
+#define crypto_hash_sha512 crypto_hash_sha512_tinyssh
+#define crypto_hash_sha512_BYTES crypto_hash_sha512_tinyssh_BYTES
+#define crypto_hash_sha512_IMPLEMENTATION "tinyssh"
 #define crypto_hash_sha512_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/crypto_kem_sntrup4591761.c 20220801-1/crypto/crypto_kem_sntrup4591761.c
--- 20190101-1/crypto/crypto_kem_sntrup4591761.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup4591761.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,1148 +0,0 @@
-/*
-Original code: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref
-Modifications (Jan Mojzis):
-- source code merged into single file
-- crypto_kem renamed to crypto_kem_sntrup4591761_tinynacl
-*/
-
-/* See https://ntruprime.cr.yp.to/software.html for detailed documentation. */
-
-#include <string.h>
-#include "crypto_uint32.h"
-#include "crypto_uint16.h"
-#include "crypto_int32.h"
-#include "crypto_int16.h"
-#include "crypto_int8.h"
-#include "randombytes.h"
-#include "crypto_verify_32.h"
-#include "crypto_hash_sha512.h"
-#include "crypto_kem_sntrup4591761.h"
-
-/* int32_sort.c */
-
-
-static void minmax(crypto_int32 *x,crypto_int32 *y)
-{
-  crypto_uint32 xi = *x;
-  crypto_uint32 yi = *y;
-  crypto_uint32 xy = xi ^ yi;
-  crypto_uint32 c = yi - xi;
-  c ^= xy & (c ^ yi);
-  c >>= 31;
-  c = -c;
-  c &= xy;
-  *x = xi ^ c;
-  *y = yi ^ c;
-}
-
-static void int32_sort(crypto_int32 *x,int n)
-{
-  int top,p,q,i;
-
-  if (n < 2) return;
-  top = 1;
-  while (top < n - top) top += top;
-
-  for (p = top;p > 0;p >>= 1) {
-    for (i = 0;i < n - p;++i)
-      if (!(i & p))
-        minmax(x + i,x + i + p);
-    for (q = top;q > p;q >>= 1)
-      for (i = 0;i < n - q;++i)
-        if (!(i & p))
-          minmax(x + i + p,x + i + q);
-  }
-}
-
-/* swap.c */
-
-
-static void swap(void *x,void *y,int bytes,int mask)
-{
-  int i;
-  char xi, yi, c, t;
-
-  c = mask;
-  
-  for (i = 0;i < bytes;++i) {
-    xi = i[(char *) x];
-    yi = i[(char *) y];
-    t = c & (xi ^ yi);
-    xi ^= t;
-    yi ^= t;
-    i[(char *) x] = xi;
-    i[(char *) y] = yi;
-  }
-}
-
-/* params.h */
-#ifndef params_h
-#define params_h
-
-#define q 4591
-/* XXX: also built into modq in various ways */
-
-#define qshift 2295
-#define p 761
-#define w 286
-
-#define rq_encode_len 1218
-#define small_encode_len 191
-
-#endif
-
-/* small.h */
-typedef crypto_int8 small;
-
-/* small.c */
-
-
-/* XXX: these functions rely on p mod 4 = 1 */
-
-/* all coefficients in -1, 0, 1 */
-static void small_encode(unsigned char *c,const small *f)
-{
-  small c0;
-  int i;
-
-  for (i = 0;i < p/4;++i) {
-    c0 = *f++ + 1;
-    c0 += (*f++ + 1) << 2;
-    c0 += (*f++ + 1) << 4;
-    c0 += (*f++ + 1) << 6;
-    *c++ = c0;
-  }
-  c0 = *f++ + 1;
-  *c++ = c0;
-}
-
-static void small_decode(small *f,const unsigned char *c)
-{
-  unsigned char c0;
-  int i;
-
-  for (i = 0;i < p/4;++i) {
-    c0 = *c++;
-    *f++ = ((small) (c0 & 3)) - 1; c0 >>= 2;
-    *f++ = ((small) (c0 & 3)) - 1; c0 >>= 2;
-    *f++ = ((small) (c0 & 3)) - 1; c0 >>= 2;
-    *f++ = ((small) (c0 & 3)) - 1;
-  }
-  c0 = *c++;
-  *f++ = ((small) (c0 & 3)) - 1;
-}
-
-/* random32.c */
-
-
-#ifdef KAT
-/* NIST KAT generator fails to provide chunk-independence */
-static unsigned char x[4*761];
-static long long pos = 4*761;
-#endif
-
-static crypto_int32 small_random32(void)
-{
-#ifdef KAT
-  if (pos == 4*761) {
-    randombytes(x,sizeof x);
-    pos = 0;
-  }
-  pos += 4;
-  return x[pos - 4] + (x[pos - 3] << 8) + (x[pos - 2] << 16) + (x[pos - 1] << 24);
-#else
-  unsigned char x[4];
-  randombytes(x,4);
-  return x[0] + (x[1] << 8) + (x[2] << 16) + (x[3] << 24);
-#endif
-}
-
-/* randomsmall.c */
-
-
-static void small_random(small *g)
-{
-  int i;
-
-  for (i = 0;i < p;++i) {
-    crypto_uint32 r = small_random32();
-    g[i] = (small) (((1073741823 & r) * 3) >> 30) - 1;
-  }
-}
-
-/* randomweightw.c */
-
-
-static void small_random_weightw(small *f)
-{
-  crypto_int32 r[p];
-  int i;
-
-  for (i = 0;i < p;++i) r[i] = small_random32();
-  for (i = 0;i < w;++i) r[i] &= -2;
-  for (i = w;i < p;++i) r[i] = (r[i] & -3) | 1;
-  int32_sort(r,p);
-  for (i = 0;i < p;++i) f[i] = ((small) (r[i] & 3)) - 1;
-}
-
-/* mod3.h */
-#ifndef mod3_h
-#define mod3_h
-
-
-/* -1 if x is nonzero, 0 otherwise */
-static inline int mod3_nonzero_mask(small x)
-{
-  return -x*x;
-}
-
-/* input between -100000 and 100000 */
-/* output between -1 and 1 */
-static inline small mod3_freeze(crypto_int32 a)
-{
-  a -= 3 * ((10923 * a) >> 15);
-  a -= 3 * ((89478485 * a + 134217728) >> 28);
-  return a;
-}
-
-static inline small mod3_minusproduct(small a,small b,small c)
-{
-  crypto_int32 A = a;
-  crypto_int32 B = b;
-  crypto_int32 C = c;
-  return mod3_freeze(A - B * C);
-}
-
-static inline small mod3_plusproduct(small a,small b,small c)
-{
-  crypto_int32 A = a;
-  crypto_int32 B = b;
-  crypto_int32 C = c;
-  return mod3_freeze(A + B * C);
-}
-
-static inline small mod3_product(small a,small b)
-{
-  return a * b;
-}
-
-static inline small mod3_sum(small a,small b)
-{
-  crypto_int32 A = a;
-  crypto_int32 B = b;
-  return mod3_freeze(A + B);
-}
-
-static inline small mod3_reciprocal(small a1)
-{
-  return a1;
-}
-
-static inline small mod3_quotient(small num,small den)
-{
-  return mod3_product(num,mod3_reciprocal(den));
-}
-
-#endif
-
-/* r3_mult.c */
-
-
-static void r3_mult(small *h,const small *f,const small *g)
-{
-  small fg[p + p - 1];
-  small result;
-  int i, j;
-
-  for (i = 0;i < p;++i) {
-    result = 0;
-    for (j = 0;j <= i;++j)
-      result = mod3_plusproduct(result,f[j],g[i - j]);
-    fg[i] = result;
-  }
-  for (i = p;i < p + p - 1;++i) {
-    result = 0;
-    for (j = i - p + 1;j < p;++j)
-      result = mod3_plusproduct(result,f[j],g[i - j]);
-    fg[i] = result;
-  }
-
-  for (i = p + p - 2;i >= p;--i) {
-    fg[i - p] = mod3_sum(fg[i - p],fg[i]);
-    fg[i - p + 1] = mod3_sum(fg[i - p + 1],fg[i]);
-  }
-
-  for (i = 0;i < p;++i)
-    h[i] = fg[i];
-}
-
-/* r3_recip.c */
-
-
-/* caller must ensure that x-y does not overflow */
-static int smaller_mask(int x,int y)
-{
-  return (x - y) >> 31;
-}
-
-static void vectormod3_product(small *z,int len,const small *x,const small c)
-{
-  int i;
-  for (i = 0;i < len;++i) z[i] = mod3_product(x[i],c);
-}
-
-static void vectormod3_minusproduct(small *z,int len,const small *x,const small *y,const small c)
-{
-  int i;
-  for (i = 0;i < len;++i) z[i] = mod3_minusproduct(x[i],y[i],c);
-}
-
-static void vectormod3_shift(small *z,int len)
-{
-  int i;
-  for (i = len - 1;i > 0;--i) z[i] = z[i - 1];
-  z[0] = 0;
-}
-
-/*
-r = s^(-1) mod m, returning 0, if s is invertible mod m
-or returning -1 if s is not invertible mod m
-r,s are polys of degree <p
-m is x^p-x-1
-*/
-int r3_recip(small *r,const small *s)
-{
-  const int loops = 2*p + 1;
-  int loop;
-  small f[p + 1]; 
-  small g[p + 1]; 
-  small u[loops + 1];
-  small v[loops + 1];
-  small c;
-  int i;
-  int d = p;
-  int e = p;
-  int swapmask;
-
-  for (i = 2;i < p;++i) f[i] = 0;
-  f[0] = -1;
-  f[1] = -1;
-  f[p] = 1;
-  /* generalization: can initialize f to any polynomial m */
-  /* requirements: m has degree exactly p, nonzero constant coefficient */
-
-  for (i = 0;i < p;++i) g[i] = s[i];
-  g[p] = 0;
-
-  for (i = 0;i <= loops;++i) u[i] = 0;
-
-  v[0] = 1;
-  for (i = 1;i <= loops;++i) v[i] = 0;
-
-  loop = 0;
-  for (;;) {
-    /* e == -1 or d + e + loop <= 2*p */
-
-    /* f has degree p: i.e., f[p]!=0 */
-    /* f[i]==0 for i < p-d */
-
-    /* g has degree <=p (so it fits in p+1 coefficients) */
-    /* g[i]==0 for i < p-e */
-
-    /* u has degree <=loop (so it fits in loop+1 coefficients) */
-    /* u[i]==0 for i < p-d */
-    /* if invertible: u[i]==0 for i < loop-p (so can look at just p+1 coefficients) */
-
-    /* v has degree <=loop (so it fits in loop+1 coefficients) */
-    /* v[i]==0 for i < p-e */
-    /* v[i]==0 for i < loop-p (so can look at just p+1 coefficients) */
-
-    if (loop >= loops) break;
-
-    c = mod3_quotient(g[p],f[p]);
-
-    vectormod3_minusproduct(g,p + 1,g,f,c);
-    vectormod3_shift(g,p + 1);
-
-#ifdef SIMPLER
-    vectormod3_minusproduct(v,loops + 1,v,u,c);
-    vectormod3_shift(v,loops + 1);
-#else
-    if (loop < p) {
-      vectormod3_minusproduct(v,loop + 1,v,u,c);
-      vectormod3_shift(v,loop + 2);
-    } else {
-      vectormod3_minusproduct(v + loop - p,p + 1,v + loop - p,u + loop - p,c);
-      vectormod3_shift(v + loop - p,p + 2);
-    }
-#endif
-
-    e -= 1;
-
-    ++loop;
-
-    swapmask = smaller_mask(e,d) & mod3_nonzero_mask(g[p]);
-    swap(&e,&d,sizeof e,swapmask);
-    swap(f,g,(p + 1) * sizeof(small),swapmask);
-
-#ifdef SIMPLER
-    swap(u,v,(loops + 1) * sizeof(small),swapmask);
-#else
-    if (loop < p) {
-      swap(u,v,(loop + 1) * sizeof(small),swapmask);
-    } else {
-      swap(u + loop - p,v + loop - p,(p + 1) * sizeof(small),swapmask);
-    }
-#endif
-  }
-
-  c = mod3_reciprocal(f[p]);
-  vectormod3_product(r,p,u + p,c);
-  return smaller_mask(0,d);
-}
-
-/* modq.h */
-#ifndef modq_h
-#define modq_h
-
-
-typedef crypto_int16 modq;
-
-/* -1 if x is nonzero, 0 otherwise */
-static inline int modq_nonzero_mask(modq x)
-{
-  crypto_int32 r = (crypto_uint16) x;
-  r = -r;
-  r >>= 30;
-  return r;
-}
-
-/* input between -9000000 and 9000000 */
-/* output between -2295 and 2295 */
-static inline modq modq_freeze(crypto_int32 a)
-{
-  a -= 4591 * ((228 * a) >> 20);
-  a -= 4591 * ((58470 * a + 134217728) >> 28);
-  return a;
-}
-
-static inline modq modq_minusproduct(modq a,modq b,modq c)
-{
-  crypto_int32 A = a;
-  crypto_int32 B = b;
-  crypto_int32 C = c;
-  return modq_freeze(A - B * C);
-}
-
-static inline modq modq_plusproduct(modq a,modq b,modq c)
-{
-  crypto_int32 A = a;
-  crypto_int32 B = b;
-  crypto_int32 C = c;
-  return modq_freeze(A + B * C);
-}
-
-static inline modq modq_product(modq a,modq b)
-{
-  crypto_int32 A = a;
-  crypto_int32 B = b;
-  return modq_freeze(A * B);
-}
-
-static inline modq modq_square(modq a)
-{
-  crypto_int32 A = a;
-  return modq_freeze(A * A);
-}
-
-static inline modq modq_sum(modq a,modq b)
-{
-  crypto_int32 A = a;
-  crypto_int32 B = b;
-  return modq_freeze(A + B);
-}
-
-static inline modq modq_reciprocal(modq a1)
-{
-  modq a2 = modq_square(a1);
-  modq a3 = modq_product(a2,a1);
-  modq a4 = modq_square(a2);
-  modq a8 = modq_square(a4);
-  modq a16 = modq_square(a8);
-  modq a32 = modq_square(a16);
-  modq a35 = modq_product(a32,a3);
-  modq a70 = modq_square(a35);
-  modq a140 = modq_square(a70);
-  modq a143 = modq_product(a140,a3);
-  modq a286 = modq_square(a143);
-  modq a572 = modq_square(a286);
-  modq a1144 = modq_square(a572);
-  modq a1147 = modq_product(a1144,a3);
-  modq a2294 = modq_square(a1147);
-  modq a4588 = modq_square(a2294);
-  modq a4589 = modq_product(a4588,a1);
-  return a4589;
-}
-
-static inline modq modq_quotient(modq num,modq den)
-{
-  return modq_product(num,modq_reciprocal(den));
-}
-
-#endif
-
-/* rq.c */
-
-
-static void rq_encode(unsigned char *c,const modq *f)
-{
-  crypto_int32 f0, f1, f2, f3, f4;
-  int i;
-
-  for (i = 0;i < p/5;++i) {
-    f0 = *f++ + qshift;
-    f1 = *f++ + qshift;
-    f2 = *f++ + qshift;
-    f3 = *f++ + qshift;
-    f4 = *f++ + qshift;
-    /* now want f0 + 6144*f1 + ... as a 64-bit integer */
-    f1 *= 3;
-    f2 *= 9;
-    f3 *= 27;
-    f4 *= 81;
-    /* now want f0 + f1<<11 + f2<<22 + f3<<33 + f4<<44 */
-    f0 += f1 << 11;
-    *c++ = f0; f0 >>= 8;
-    *c++ = f0; f0 >>= 8;
-    f0 += f2 << 6;
-    *c++ = f0; f0 >>= 8;
-    *c++ = f0; f0 >>= 8;
-    f0 += f3 << 1;
-    *c++ = f0; f0 >>= 8;
-    f0 += f4 << 4;
-    *c++ = f0; f0 >>= 8;
-    *c++ = f0; f0 >>= 8;
-    *c++ = f0;
-  }
-  /* XXX: using p mod 5 = 1 */
-  f0 = *f++ + qshift;
-  *c++ = f0; f0 >>= 8;
-  *c++ = f0;
-}
-
-static void rq_decode(modq *f,const unsigned char *c)
-{
-  crypto_uint32 c0, c1, c2, c3, c4, c5, c6, c7;
-  crypto_uint32 f0, f1, f2, f3, f4;
-  int i;
-
-  for (i = 0;i < p/5;++i) {
-    c0 = *c++;
-    c1 = *c++;
-    c2 = *c++;
-    c3 = *c++;
-    c4 = *c++;
-    c5 = *c++;
-    c6 = *c++;
-    c7 = *c++;
-
-    /* f0 + f1*6144 + f2*6144^2 + f3*6144^3 + f4*6144^4 */
-    /* = c0 + c1*256 + ... + c6*256^6 + c7*256^7 */
-    /* with each f between 0 and 4590 */
-
-    c6 += c7 << 8;
-    /* c6 <= 23241 = floor(4591*6144^4/2^48) */
-    /* f4 = (16/81)c6 + (1/1296)(c5+[0,1]) - [0,0.75] */
-    /* claim: 2^19 f4 < x < 2^19(f4+1) */
-    /* where x = 103564 c6 + 405(c5+1) */
-    /* proof: x - 2^19 f4 = (76/81)c6 + (37/81)c5 + 405 - (32768/81)[0,1] + 2^19[0,0.75] */
-    /* at least 405 - 32768/81 > 0 */
-    /* at most (76/81)23241 + (37/81)255 + 405 + 2^19 0.75 < 2^19 */
-    f4 = (103564*c6 + 405*(c5+1)) >> 19;
-
-    c5 += c6 << 8;
-    c5 -= (f4 * 81) << 4;
-    c4 += c5 << 8;
-
-    /* f0 + f1*6144 + f2*6144^2 + f3*6144^3 */
-    /* = c0 + c1*256 + c2*256^2 + c3*256^3 + c4*256^4 */
-    /* c4 <= 247914 = floor(4591*6144^3/2^32) */
-    /* f3 = (1/54)(c4+[0,1]) - [0,0.75] */
-    /* claim: 2^19 f3 < x < 2^19(f3+1) */
-    /* where x = 9709(c4+2) */
-    /* proof: x - 2^19 f3 = 19418 - (1/27)c4 - (262144/27)[0,1] + 2^19[0,0.75] */
-    /* at least 19418 - 247914/27 - 262144/27 > 0 */
-    /* at most 19418 + 2^19 0.75 < 2^19 */
-    f3 = (9709*(c4+2)) >> 19;
-
-    c4 -= (f3 * 27) << 1;
-    c3 += c4 << 8;
-    /* f0 + f1*6144 + f2*6144^2 */
-    /* = c0 + c1*256 + c2*256^2 + c3*256^3 */
-    /* c3 <= 10329 = floor(4591*6144^2/2^24) */
-    /* f2 = (4/9)c3 + (1/576)c2 + (1/147456)c1 + (1/37748736)c0 - [0,0.75] */
-    /* claim: 2^19 f2 < x < 2^19(f2+1) */
-    /* where x = 233017 c3 + 910(c2+2) */
-    /* proof: x - 2^19 f2 = 1820 + (1/9)c3 - (2/9)c2 - (32/9)c1 - (1/72)c0 + 2^19[0,0.75] */
-    /* at least 1820 - (2/9)255 - (32/9)255 - (1/72)255 > 0 */
-    /* at most 1820 + (1/9)10329 + 2^19 0.75 < 2^19 */
-    f2 = (233017*c3 + 910*(c2+2)) >> 19;
-
-    c2 += c3 << 8;
-    c2 -= (f2 * 9) << 6;
-    c1 += c2 << 8;
-    /* f0 + f1*6144 */
-    /* = c0 + c1*256 */
-    /* c1 <= 110184 = floor(4591*6144/2^8) */
-    /* f1 = (1/24)c1 + (1/6144)c0 - (1/6144)f0 */
-    /* claim: 2^19 f1 < x < 2^19(f1+1) */
-    /* where x = 21845(c1+2) + 85 c0 */
-    /* proof: x - 2^19 f1 = 43690 - (1/3)c1 - (1/3)c0 + 2^19 [0,0.75] */
-    /* at least 43690 - (1/3)110184 - (1/3)255 > 0 */
-    /* at most 43690 + 2^19 0.75 < 2^19 */
-    f1 = (21845*(c1+2) + 85*c0) >> 19;
-
-    c1 -= (f1 * 3) << 3;
-    c0 += c1 << 8;
-    f0 = c0;
-
-    *f++ = modq_freeze(f0 + q - qshift);
-    *f++ = modq_freeze(f1 + q - qshift);
-    *f++ = modq_freeze(f2 + q - qshift);
-    *f++ = modq_freeze(f3 + q - qshift);
-    *f++ = modq_freeze(f4 + q - qshift);
-  }
-
-  c0 = *c++;
-  c1 = *c++;
-  c0 += c1 << 8;
-  *f++ = modq_freeze(c0 + q - qshift);
-}
-
-/* rq_mult.c */
-
-
-static void rq_mult(modq *h,const modq *f,const small *g)
-{
-  modq fg[p + p - 1];
-  modq result;
-  int i, j;
-
-  for (i = 0;i < p;++i) {
-    result = 0;
-    for (j = 0;j <= i;++j)
-      result = modq_plusproduct(result,f[j],g[i - j]);
-    fg[i] = result;
-  }
-  for (i = p;i < p + p - 1;++i) {
-    result = 0;
-    for (j = i - p + 1;j < p;++j)
-      result = modq_plusproduct(result,f[j],g[i - j]);
-    fg[i] = result;
-  }
-
-  for (i = p + p - 2;i >= p;--i) {
-    fg[i - p] = modq_sum(fg[i - p],fg[i]);
-    fg[i - p + 1] = modq_sum(fg[i - p + 1],fg[i]);
-  }
-
-  for (i = 0;i < p;++i)
-    h[i] = fg[i];
-}
-
-/* rq_recip3.c */
-
-
-/* caller must ensure that x-y does not overflow */
-static int smaller_maskq(int x,int y)
-{
-  return (x - y) >> 31;
-}
-
-static void vectormodq_product(modq *z,int len,const modq *x,const modq c)
-{
-  int i;
-  for (i = 0;i < len;++i) z[i] = modq_product(x[i],c);
-}
-
-static void vectormodq_minusproduct(modq *z,int len,const modq *x,const modq *y,const modq c)
-{
-  int i;
-  for (i = 0;i < len;++i) z[i] = modq_minusproduct(x[i],y[i],c);
-}
-
-static void vectormodq_shift(modq *z,int len)
-{
-  int i;
-  for (i = len - 1;i > 0;--i) z[i] = z[i - 1];
-  z[0] = 0;
-}
-
-/*
-r = (3s)^(-1) mod m, returning 0, if s is invertible mod m
-or returning -1 if s is not invertible mod m
-r,s are polys of degree <p
-m is x^p-x-1
-*/
-static int rq_recip3(modq *r,const small *s)
-{
-  const int loops = 2*p + 1;
-  int loop;
-  modq f[p + 1]; 
-  modq g[p + 1]; 
-  modq u[loops + 1];
-  modq v[loops + 1];
-  modq c;
-  int i;
-  int d = p;
-  int e = p;
-  int swapmask;
-
-  for (i = 2;i < p;++i) f[i] = 0;
-  f[0] = -1;
-  f[1] = -1;
-  f[p] = 1;
-  /* generalization: can initialize f to any polynomial m */
-  /* requirements: m has degree exactly p, nonzero constant coefficient */
-
-  for (i = 0;i < p;++i) g[i] = 3 * s[i];
-  g[p] = 0;
-
-  for (i = 0;i <= loops;++i) u[i] = 0;
-
-  v[0] = 1;
-  for (i = 1;i <= loops;++i) v[i] = 0;
-
-  loop = 0;
-  for (;;) {
-    /* e == -1 or d + e + loop <= 2*p */
-
-    /* f has degree p: i.e., f[p]!=0 */
-    /* f[i]==0 for i < p-d */
-
-    /* g has degree <=p (so it fits in p+1 coefficients) */
-    /* g[i]==0 for i < p-e */
-
-    /* u has degree <=loop (so it fits in loop+1 coefficients) */
-    /* u[i]==0 for i < p-d */
-    /* if invertible: u[i]==0 for i < loop-p (so can look at just p+1 coefficients) */
-
-    /* v has degree <=loop (so it fits in loop+1 coefficients) */
-    /* v[i]==0 for i < p-e */
-    /* v[i]==0 for i < loop-p (so can look at just p+1 coefficients) */
-
-    if (loop >= loops) break;
-
-    c = modq_quotient(g[p],f[p]);
-
-    vectormodq_minusproduct(g,p + 1,g,f,c);
-    vectormodq_shift(g,p + 1);
-
-#ifdef SIMPLER
-    vectormodq_minusproduct(v,loops + 1,v,u,c);
-    vectormodq_shift(v,loops + 1);
-#else
-    if (loop < p) {
-      vectormodq_minusproduct(v,loop + 1,v,u,c);
-      vectormodq_shift(v,loop + 2);
-    } else {
-      vectormodq_minusproduct(v + loop - p,p + 1,v + loop - p,u + loop - p,c);
-      vectormodq_shift(v + loop - p,p + 2);
-    }
-#endif
-
-    e -= 1;
-
-    ++loop;
-
-    swapmask = smaller_maskq(e,d) & modq_nonzero_mask(g[p]);
-    swap(&e,&d,sizeof e,swapmask);
-    swap(f,g,(p + 1) * sizeof(modq),swapmask);
-
-#ifdef SIMPLER
-    swap(u,v,(loops + 1) * sizeof(modq),swapmask);
-#else
-    if (loop < p) {
-      swap(u,v,(loop + 1) * sizeof(modq),swapmask);
-    } else {
-      swap(u + loop - p,v + loop - p,(p + 1) * sizeof(modq),swapmask);
-    }
-#endif
-  }
-
-  c = modq_reciprocal(f[p]);
-  vectormodq_product(r,p,u + p,c);
-  return smaller_maskq(0,d);
-}
-
-/* rq_round3.c */
-
-
-static void rq_round3(modq *h,const modq *f)
-{
-  int i;
-
-  for (i = 0;i < p;++i)
-    h[i] = ((21846 * (f[i] + 2295) + 32768) >> 16) * 3 - 2295;
-}
-
-/* rq_rounded.c */
-
-
-static void rq_encoderounded(unsigned char *c,const modq *f)
-{
-  crypto_int32 f0, f1, f2;
-  int i;
-
-  for (i = 0;i < p/3;++i) {
-    f0 = *f++ + qshift;
-    f1 = *f++ + qshift;
-    f2 = *f++ + qshift;
-    f0 = (21846 * f0) >> 16;
-    f1 = (21846 * f1) >> 16;
-    f2 = (21846 * f2) >> 16;
-    /* now want f0 + f1*1536 + f2*1536^2 as a 32-bit integer */
-    f2 *= 3;
-    f1 += f2 << 9;
-    f1 *= 3;
-    f0 += f1 << 9;
-    *c++ = f0; f0 >>= 8;
-    *c++ = f0; f0 >>= 8;
-    *c++ = f0; f0 >>= 8;
-    *c++ = f0;
-  }
-  /* XXX: using p mod 3 = 2 */
-  f0 = *f++ + qshift;
-  f1 = *f++ + qshift;
-  f0 = (21846 * f0) >> 16;
-  f1 = (21846 * f1) >> 16;
-  f1 *= 3;
-  f0 += f1 << 9;
-  *c++ = f0; f0 >>= 8;
-  *c++ = f0; f0 >>= 8;
-  *c++ = f0;
-}
-
-static void rq_decoderounded(modq *f,const unsigned char *c)
-{
-  crypto_uint32 c0, c1, c2, c3;
-  crypto_uint32 f0, f1, f2;
-  int i;
-
-  for (i = 0;i < p/3;++i) {
-    c0 = *c++;
-    c1 = *c++;
-    c2 = *c++;
-    c3 = *c++;
-
-    /* f0 + f1*1536 + f2*1536^2 */
-    /* = c0 + c1*256 + c2*256^2 + c3*256^3 */
-    /* with each f between 0 and 1530 */
-
-    /* f2 = (64/9)c3 + (1/36)c2 + (1/9216)c1 + (1/2359296)c0 - [0,0.99675] */
-    /* claim: 2^21 f2 < x < 2^21(f2+1) */
-    /* where x = 14913081*c3 + 58254*c2 + 228*(c1+2) */
-    /* proof: x - 2^21 f2 = 456 - (8/9)c0 + (4/9)c1 - (2/9)c2 + (1/9)c3 + 2^21 [0,0.99675] */
-    /* at least 456 - (8/9)255 - (2/9)255 > 0 */
-    /* at most 456 + (4/9)255 + (1/9)255 + 2^21 0.99675 < 2^21 */
-    f2 = (14913081*c3 + 58254*c2 + 228*(c1+2)) >> 21;
-
-    c2 += c3 << 8;
-    c2 -= (f2 * 9) << 2;
-    /* f0 + f1*1536 */
-    /* = c0 + c1*256 + c2*256^2 */
-    /* c2 <= 35 = floor((1530+1530*1536)/256^2) */
-    /* f1 = (128/3)c2 + (1/6)c1 + (1/1536)c0 - (1/1536)f0 */
-    /* claim: 2^21 f1 < x < 2^21(f1+1) */
-    /* where x = 89478485*c2 + 349525*c1 + 1365*(c0+1) */
-    /* proof: x - 2^21 f1 = 1365 - (1/3)c2 - (1/3)c1 - (1/3)c0 + (4096/3)f0 */
-    /* at least 1365 - (1/3)35 - (1/3)255 - (1/3)255 > 0 */
-    /* at most 1365 + (4096/3)1530 < 2^21 */
-    f1 = (89478485*c2 + 349525*c1 + 1365*(c0+1)) >> 21;
-
-    c1 += c2 << 8;
-    c1 -= (f1 * 3) << 1;
-
-    c0 += c1 << 8;
-    f0 = c0;
-
-    *f++ = modq_freeze(f0 * 3 + q - qshift);
-    *f++ = modq_freeze(f1 * 3 + q - qshift);
-    *f++ = modq_freeze(f2 * 3 + q - qshift);
-  }
-
-  c0 = *c++;
-  c1 = *c++;
-  c2 = *c++;
-
-  f1 = (89478485*c2 + 349525*c1 + 1365*(c0+1)) >> 21;
-
-  c1 += c2 << 8;
-  c1 -= (f1 * 3) << 1;
-
-  c0 += c1 << 8;
-  f0 = c0;
-
-  *f++ = modq_freeze(f0 * 3 + q - qshift);
-  *f++ = modq_freeze(f1 * 3 + q - qshift);
-}
-
-/* keypair.c */
-
-
-#if crypto_kem_sntrup4591761_tinynacl_PUBLICKEYBYTES != rq_encode_len
-#error "crypto_kem_sntrup4591761_tinynacl_PUBLICKEYBYTES must match rq_encode_len"
-#endif
-#if crypto_kem_sntrup4591761_tinynacl_SECRETKEYBYTES != rq_encode_len + 2 * small_encode_len
-#error "crypto_kem_sntrup4591761_tinynacl_SECRETKEYBYTES must match rq_encode_len + 2 * small_encode_len"
-#endif
-
-int crypto_kem_sntrup4591761_tinynacl_keypair(unsigned char *pk,unsigned char *sk)
-{
-  small g[p];
-  small grecip[p];
-  small f[p];
-  modq f3recip[p];
-  modq h[p];
-
-  do
-    small_random(g);
-  while (r3_recip(grecip,g) != 0);
-
-  small_random_weightw(f);
-  rq_recip3(f3recip,f);
-
-  rq_mult(h,f3recip,g);
-
-  rq_encode(pk,h);
-  small_encode(sk,f);
-  small_encode(sk + small_encode_len,grecip);
-  memcpy(sk + 2 * small_encode_len,pk,rq_encode_len);
-
-  return 0;
-}
-
-/* enc.c */
-
-#ifdef KAT
-#endif
-
-
-int crypto_kem_sntrup4591761_tinynacl_enc(
-  unsigned char *cstr,
-  unsigned char *k,
-  const unsigned char *pk
-)
-{
-  small r[p];
-  modq h[p];
-  modq c[p];
-  unsigned char rstr[small_encode_len];
-  unsigned char hash[64];
-
-  small_random_weightw(r);
-
-#ifdef KAT
-  {
-    int i;
-    printf("encrypt r:");
-    for (i = 0;i < p;++i)
-      if (r[i] == 1) printf(" +%d",i);
-      else if (r[i] == -1) printf(" -%d",i);
-    printf("\n");
-  }
-#endif
-
-  small_encode(rstr,r);
-  crypto_hash_sha512(hash,rstr,sizeof rstr);
-
-  rq_decode(h,pk);
-  rq_mult(c,h,r);
-  rq_round3(c,c);
-
-  memcpy(k,hash + 32,32);
-  memcpy(cstr,hash,32);
-  rq_encoderounded(cstr + 32,c);
-
-  return 0;
-}
-
-/* dec.c */
-
-#ifdef KAT
-#endif
-
-
-int crypto_kem_sntrup4591761_tinynacl_dec(
-  unsigned char *k,
-  const unsigned char *cstr,
-  const unsigned char *sk
-)
-{
-  small f[p];
-  modq h[p];
-  small grecip[p];
-  modq c[p];
-  modq t[p];
-  small t3[p];
-  small r[p];
-  modq hr[p];
-  unsigned char rstr[small_encode_len];
-  unsigned char hash[64];
-  int i;
-  int result = 0;
-  int weight;
-
-  small_decode(f,sk);
-  small_decode(grecip,sk + small_encode_len);
-  rq_decode(h,sk + 2 * small_encode_len);
-
-  rq_decoderounded(c,cstr + 32);
-
-  rq_mult(t,c,f);
-  for (i = 0;i < p;++i) t3[i] = mod3_freeze(modq_freeze(3*t[i]));
-
-  r3_mult(r,t3,grecip);
-
-#ifdef KAT
-  {
-    int j;
-    printf("decrypt r:");
-    for (j = 0;j < p;++j)
-      if (r[j] == 1) printf(" +%d",j);
-      else if (r[j] == -1) printf(" -%d",j);
-    printf("\n");
-  }
-#endif
-
-  weight = 0;
-  for (i = 0;i < p;++i) weight += (1 & r[i]);
-  weight -= w;
-  result |= modq_nonzero_mask(weight); /* XXX: puts limit on p */
-
-  rq_mult(hr,h,r);
-  rq_round3(hr,hr);
-  for (i = 0;i < p;++i) result |= modq_nonzero_mask(hr[i] - c[i]);
-
-  small_encode(rstr,r);
-  crypto_hash_sha512(hash,rstr,sizeof rstr);
-  result |= crypto_verify_32(hash,cstr);
-
-  for (i = 0;i < 32;++i) k[i] = (hash[32 + i] & ~result);
-  return result;
-}
-
-
-#if 0
-Script used for merge into single file:
-
-#!/bin/sh
-
-rm crypto_kem_sntrup4591761.c || :
-
-(
-
-  echo '/*'
-  echo 'Original code: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref'
-  echo 'Modifications (Jan Mojzis):'
-  echo '- source code merged into single file'
-  echo '- crypto_kem renamed to crypto_kem_sntrup4591761_tinynacl'
-  echo '*/'
-  echo
-  echo '/* See https://ntruprime.cr.yp.to/software.html for detailed documentation. */'
-  echo
-  echo '#include <string.h>'
-  echo '#include "crypto_uint32.h"'
-  echo '#include "crypto_uint16.h"'
-  echo '#include "crypto_int32.h"'
-  echo '#include "crypto_int16.h"'
-  echo '#include "crypto_int8.h"'
-  echo '#include "randombytes.h"'
-  echo '#include "crypto_verify_32.h"'
-  echo '#include "crypto_hash_sha512.h"'
-  echo '#include "crypto_kem_sntrup4591761.h"'
-  echo
-  (
-    echo '/* int32_sort.c */'
-    cat int32_sort.c | sed 's/^void /static void /'
-    echo
-
-    echo '/* swap.c */'
-    cat swap.c | sed 's/^void /static void /'
-    echo
-
-    echo '/* params.h */'
-    cat params.h 
-    echo
-
-    echo '/* small.h */'
-    echo 'typedef crypto_int8 small;'
-    echo 
-    echo '/* small.c */'
-    cat small.c | sed 's/^void /static void /'
-    echo
-    echo '/* random32.c */'
-    cat random32.c | sed 's/^crypto_int32 /static crypto_int32 /'
-    echo
-    echo '/* randomsmall.c */'
-    cat randomsmall.c | sed 's/^void /static void /'
-    echo
-    echo '/* randomweightw.c */'
-    cat randomweightw.c | sed 's/^void /static void /'
-    echo
-
-    echo '/* mod3.h */'
-    cat mod3.h
-    echo
-    echo '/* r3_mult.c */'
-    cat r3_mult.c | sed 's/^void /static void /'
-    echo
-    echo '/* r3_recip.c */'
-    cat r3_recip.c | sed 's/^void /static void /'
-    echo
-
-    echo '/* modq.h */'
-    cat modq.h
-    echo
-    echo '/* rq.c */'
-    cat rq.c | sed 's/^void /static void /'
-    echo
-    echo '/* rq_mult.c */'
-    cat rq_mult.c | sed 's/^void /static void /'
-    echo
-    echo '/* rq_recip3.c */'
-    cat rq_recip3.c | sed 's/smaller_mask/smaller_maskq/' | sed 's/^int /static int /'
-    echo
-    echo '/* rq_round3.c */'
-    cat rq_round3.c | sed 's/^void /static void /'
-    echo
-    echo '/* rq_rounded.c */'
-    cat rq_rounded.c | sed 's/^void /static void /'
-    echo
-
-    (
-      echo '/* keypair.c */'
-      cat keypair.c
-      echo
-      echo '/* enc.c */'
-      cat enc.c
-      echo
-      echo '/* dec.c */'
-      cat dec.c
-      echo
-    ) | sed 's/crypto_kem/crypto_kem_sntrup4591761_tinynacl/g'
-
-  ) | grep -v '^#include' | grep -v 'See https://ntruprime.cr.yp.to/software.html for detailed documentation'
-
-  echo
-  echo '#if 0'
-  echo 'Script used for merge into single file:'
-  echo
-  cat $0
-  echo
-  echo '#endif'
-
-) > crypto_kem_sntrup4591761.c.tmp
-mv -f crypto_kem_sntrup4591761.c.tmp crypto_kem_sntrup4591761.c
-
-#endif
diff -pruN 20190101-1/crypto/crypto_kem_sntrup4591761.h 20220801-1/crypto/crypto_kem_sntrup4591761.h
--- 20190101-1/crypto/crypto_kem_sntrup4591761.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup4591761.h	1970-01-01 00:00:00.000000000 +0000
@@ -1,22 +0,0 @@
-#ifndef crypto_kem_sntrup4591761_H
-#define crypto_kem_sntrup4591761_H
-
-#define crypto_kem_sntrup4591761_tinynacl_SECRETKEYBYTES 1600
-#define crypto_kem_sntrup4591761_tinynacl_PUBLICKEYBYTES 1218
-#define crypto_kem_sntrup4591761_tinynacl_CIPHERTEXTBYTES 1047
-#define crypto_kem_sntrup4591761_tinynacl_BYTES 32
-extern int crypto_kem_sntrup4591761_tinynacl_keypair(unsigned char *, unsigned char *);
-extern int crypto_kem_sntrup4591761_tinynacl_enc(unsigned char *, unsigned char *, const unsigned char *);
-extern int crypto_kem_sntrup4591761_tinynacl_dec(unsigned char *, const unsigned char *, const unsigned char *);
-
-#define crypto_kem_sntrup4591761_keypair crypto_kem_sntrup4591761_tinynacl_keypair
-#define crypto_kem_sntrup4591761_enc crypto_kem_sntrup4591761_tinynacl_enc
-#define crypto_kem_sntrup4591761_dec crypto_kem_sntrup4591761_tinynacl_dec
-#define crypto_kem_sntrup4591761_SECRETKEYBYTES crypto_kem_sntrup4591761_tinynacl_SECRETKEYBYTES
-#define crypto_kem_sntrup4591761_PUBLICKEYBYTES crypto_kem_sntrup4591761_tinynacl_PUBLICKEYBYTES
-#define crypto_kem_sntrup4591761_CIPHERTEXTBYTES crypto_kem_sntrup4591761_tinynacl_CIPHERTEXTBYTES
-#define crypto_kem_sntrup4591761_BYTES crypto_kem_sntrup4591761_tinynacl_BYTES
-#define crypto_kem_sntrup4591761_IMPLEMENTATION "tinynacl"
-#define crypto_kem_sntrup4591761_VERSION "-"
-
-#endif
diff -pruN 20190101-1/crypto/crypto_kem_sntrup4591761x25519.c 20220801-1/crypto/crypto_kem_sntrup4591761x25519.c
--- 20190101-1/crypto/crypto_kem_sntrup4591761x25519.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup4591761x25519.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,120 +0,0 @@
-/*
-20181225
-Jan Mojzis
-Public domain.
-*/
-
-#include "randombytes.h"
-#include "cleanup.h"
-#include "crypto_hash_sha512.h"
-#include "crypto_scalarmult_curve25519.h"
-#include "crypto_kem_sntrup4591761.h"
-#include "crypto_kem_sntrup4591761x25519.h"
-
-#define sntrup4591761_BYTES crypto_kem_sntrup4591761_BYTES
-#define x25519_BYTES crypto_scalarmult_curve25519_BYTES
-#define x25519_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES
-#define sx_BYTES sntrup4591761_BYTES + x25519_BYTES
-#define sntrup4591761_PUBLICKEYBYTES crypto_kem_sntrup4591761_PUBLICKEYBYTES
-#define sntrup4591761_SECRETKEYBYTES crypto_kem_sntrup4591761_SECRETKEYBYTES
-#define sx_PUBLICKEYBYTES sntrup4591761_PUBLICKEYBYTES + x25519_BYTES
-#define sx_SECRETKEYBYTES sntrup4591761_SECRETKEYBYTES + x25519_SCALARBYTES
-
-static unsigned char returnmask(int x) {
-
-    unsigned long long ret = 1ULL;
-    ret <<= 8 * sizeof(int);
-    ret -= (unsigned long long)(unsigned int)x;
-    ret >>= 8 * sizeof(int);
-    return ret - 1;
-}
-
-int crypto_kem_sntrup4591761x25519_tinynacl_enc(unsigned char *c,
-                                                unsigned char *k,
-                                                const unsigned char *pk) {
-
-    int r = 0;
-    long long i;
-    unsigned char onetimesk[x25519_SCALARBYTES];
-    unsigned char buf[sx_BYTES];
-    unsigned char tmp[sx_BYTES];
-    unsigned char b;
-
-    /* sntrup4591761 */
-    r |= crypto_kem_sntrup4591761_enc(c, buf, pk);
-    pk += crypto_kem_sntrup4591761_PUBLICKEYBYTES;
-    c += crypto_kem_sntrup4591761_CIPHERTEXTBYTES;
-
-    /* x25519 */
-    randombytes(onetimesk, sizeof onetimesk);
-    r |= crypto_scalarmult_curve25519_base(/*onetimepk*/ c, onetimesk);
-    r |= crypto_scalarmult_curve25519(buf + sntrup4591761_BYTES, onetimesk, pk);
-
-    /* if something fails, fill the buffer with random data */
-    randombytes(tmp, sizeof tmp);
-    b = returnmask(r);
-    for (i = 0; i < sx_BYTES; ++i) tmp[i] = b & (tmp[i] ^ buf[i]);
-    for (i = 0; i < sx_BYTES; ++i) buf[i] ^= tmp[i];
-
-    /* hash together sntrup459176 KEM-key and x25519 shared secret */
-    crypto_hash_sha512(k, buf, sizeof buf);
-
-    /* cleanup */
-    cleanup(buf);
-    cleanup(onetimesk);
-    return r;
-}
-
-int crypto_kem_sntrup4591761x25519_tinynacl_dec(unsigned char *k,
-                                                const unsigned char *c,
-                                                const unsigned char *sk) {
-
-    int r = 0;
-    long long i;
-    unsigned char buf[sx_BYTES];
-    unsigned char tmp[sx_BYTES];
-    unsigned char b;
-
-    /* sntrup4591761 */
-    r |= crypto_kem_sntrup4591761_dec(buf, c, sk);
-    sk += crypto_kem_sntrup4591761_SECRETKEYBYTES;
-    c += crypto_kem_sntrup4591761_CIPHERTEXTBYTES;
-
-    /* x25519 */
-    r |= crypto_scalarmult_curve25519(buf + sntrup4591761_BYTES, sk, c);
-
-    /* if something fails, fill the buffer with random data */
-    randombytes(tmp, sizeof tmp);
-    b = returnmask(r);
-    for (i = 0; i < sx_BYTES; ++i) tmp[i] = b & (tmp[i] ^ buf[i]);
-    for (i = 0; i < sx_BYTES; ++i) buf[i] ^= tmp[i];
-
-    /* hash together sntrup459176 KEM-key and x25519 shared secret */
-    crypto_hash_sha512(k, buf, sizeof buf);
-
-    /* cleanup */
-    cleanup(buf);
-    return r;
-}
-
-int crypto_kem_sntrup4591761x25519_tinynacl_keypair(unsigned char *pk,
-                                                    unsigned char *sk) {
-
-    int r = 0;
-    long long i;
-    unsigned char b;
-
-    /* sntrup4591761 */
-    r |= crypto_kem_sntrup4591761_keypair(pk, sk);
-
-    /* x25519 */
-    randombytes(sk + sntrup4591761_SECRETKEYBYTES, x25519_SCALARBYTES);
-    r |= crypto_scalarmult_curve25519_base(pk + sntrup4591761_PUBLICKEYBYTES,
-                                           sk + sntrup4591761_SECRETKEYBYTES);
-
-    b = ~returnmask(r);
-    for (i = 0; i < sx_PUBLICKEYBYTES; ++i) pk[i] &= b;
-    for (i = 0; i < sx_SECRETKEYBYTES; ++i) sk[i] &= b;
-
-    return r;
-}
diff -pruN 20190101-1/crypto/crypto_kem_sntrup4591761x25519.h 20220801-1/crypto/crypto_kem_sntrup4591761x25519.h
--- 20190101-1/crypto/crypto_kem_sntrup4591761x25519.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup4591761x25519.h	1970-01-01 00:00:00.000000000 +0000
@@ -1,22 +0,0 @@
-#ifndef crypto_kem_sntrup4591761x25519_H
-#define crypto_kem_sntrup4591761x25519_H
-
-#define crypto_kem_sntrup4591761x25519_tinynacl_SECRETKEYBYTES 1632
-#define crypto_kem_sntrup4591761x25519_tinynacl_PUBLICKEYBYTES 1250
-#define crypto_kem_sntrup4591761x25519_tinynacl_CIPHERTEXTBYTES 1079
-#define crypto_kem_sntrup4591761x25519_tinynacl_BYTES 64
-extern int crypto_kem_sntrup4591761x25519_tinynacl_keypair(unsigned char *, unsigned char *);
-extern int crypto_kem_sntrup4591761x25519_tinynacl_enc(unsigned char *, unsigned char *, const unsigned char *);
-extern int crypto_kem_sntrup4591761x25519_tinynacl_dec(unsigned char *, const unsigned char *, const unsigned char *);
-
-#define crypto_kem_sntrup4591761x25519_keypair crypto_kem_sntrup4591761x25519_tinynacl_keypair
-#define crypto_kem_sntrup4591761x25519_enc crypto_kem_sntrup4591761x25519_tinynacl_enc
-#define crypto_kem_sntrup4591761x25519_dec crypto_kem_sntrup4591761x25519_tinynacl_dec
-#define crypto_kem_sntrup4591761x25519_SECRETKEYBYTES crypto_kem_sntrup4591761x25519_tinynacl_SECRETKEYBYTES
-#define crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES crypto_kem_sntrup4591761x25519_tinynacl_PUBLICKEYBYTES
-#define crypto_kem_sntrup4591761x25519_CIPHERTEXTBYTES crypto_kem_sntrup4591761x25519_tinynacl_CIPHERTEXTBYTES
-#define crypto_kem_sntrup4591761x25519_BYTES crypto_kem_sntrup4591761x25519_tinynacl_BYTES
-#define crypto_kem_sntrup4591761x25519_IMPLEMENTATION "tinynacl"
-#define crypto_kem_sntrup4591761x25519_VERSION "-"
-
-#endif
diff -pruN 20190101-1/crypto/crypto_kem_sntrup761.c 20220801-1/crypto/crypto_kem_sntrup761.c
--- 20190101-1/crypto/crypto_kem_sntrup761.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup761.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,1249 @@
+/*
+Original code: supercop-20210125/crypto_kem/sntrup761/ref
+Modifications (Jan Mojzis):
+- source code merged into single file
+- crypto_kem renamed to crypto_kem_sntrup761_tinyssh
+*/
+
+/* See https://ntruprime.cr.yp.to/software.html for detailed documentation. */
+
+#include <string.h>
+#include "crypto_uint64.h"
+#include "crypto_uint32.h"
+#include "crypto_uint16.h"
+#include "crypto_int32.h"
+#include "crypto_int16.h"
+#include "crypto_int8.h"
+#include "randombytes.h"
+#include "crypto_verify_32.h"
+#include "crypto_sort_uint32.h"
+#include "crypto_hash_sha512.h"
+#include "crypto_kem_sntrup761.h"
+
+#define uint64 crypto_uint64
+#define uint32 crypto_uint32
+#define uint16 crypto_uint16
+#define int32 crypto_int32
+#define int16 crypto_int16
+#define int8 crypto_int8
+
+/* uint32.c */
+
+/*
+CPU division instruction typically takes time depending on x.
+This software is designed to take time independent of x.
+Time still varies depending on m; user must ensure that m is constant.
+Time also varies on CPUs where multiplication is variable-time.
+There could be more CPU issues.
+There could also be compiler issues. 
+*/
+
+static void uint32_divmod_uint14(uint32 *q,uint16 *r,uint32 x,uint16 m)
+{
+  uint32 v = 0x80000000;
+  uint32 qpart;
+  uint32 mask;
+
+  v /= m;
+
+  /* caller guarantees m > 0 */
+  /* caller guarantees m < 16384 */
+  /* vm <= 2^31 <= vm+m-1 */
+  /* xvm <= 2^31 x <= xvm+x(m-1) */
+
+  *q = 0;
+
+  qpart = (x*(uint64)v)>>31;
+  /* 2^31 qpart <= xv <= 2^31 qpart + 2^31-1 */
+  /* 2^31 qpart m <= xvm <= 2^31 qpart m + (2^31-1)m */
+  /* 2^31 qpart m <= 2^31 x <= 2^31 qpart m + (2^31-1)m + x(m-1) */
+  /* 0 <= 2^31 newx <= (2^31-1)m + x(m-1) */
+  /* 0 <= newx <= (1-1/2^31)m + x(m-1)/2^31 */
+  /* 0 <= newx <= (1-1/2^31)(2^14-1) + (2^32-1)((2^14-1)-1)/2^31 */
+
+  x -= qpart*m; *q += qpart;
+  /* x <= 49146 */
+
+  qpart = (x*(uint64)v)>>31;
+  /* 0 <= newx <= (1-1/2^31)m + x(m-1)/2^31 */
+  /* 0 <= newx <= m + 49146(2^14-1)/2^31 */
+  /* 0 <= newx <= m + 0.4 */
+  /* 0 <= newx <= m */
+
+  x -= qpart*m; *q += qpart;
+  /* x <= m */
+
+  x -= m; *q += 1;
+  mask = -(x>>31);
+  x += mask&(uint32)m; *q += mask;
+  /* x < m */
+
+  *r = x;
+}
+
+uint32 uint32_div_uint14(uint32 x,uint16 m)
+{
+  uint32 q;
+  uint16 r;
+  uint32_divmod_uint14(&q,&r,x,m);
+  return q;
+}
+
+uint16 uint32_mod_uint14(uint32 x,uint16 m)
+{
+  uint32 q;
+  uint16 r;
+  uint32_divmod_uint14(&q,&r,x,m);
+  return r;
+}
+
+/* int32.c */
+
+static void int32_divmod_uint14(int32 *q,uint16 *r,int32 x,uint16 m)
+{
+  uint32 uq,uq2;
+  uint16 ur,ur2;
+  uint32 mask;
+
+  uint32_divmod_uint14(&uq,&ur,0x80000000+(uint32)x,m);
+  uint32_divmod_uint14(&uq2,&ur2,0x80000000,m);
+  ur -= ur2; uq -= uq2;
+  mask = -(uint32)(ur>>15);
+  ur += mask&m; uq += mask;
+  *r = ur; *q = uq;
+}
+
+int32 int32_div_uint14(int32 x,uint16 m)
+{
+  int32 q;
+  uint16 r;
+  int32_divmod_uint14(&q,&r,x,m);
+  return q;
+}
+
+uint16 int32_mod_uint14(int32 x,uint16 m)
+{
+  int32 q;
+  uint16 r;
+  int32_divmod_uint14(&q,&r,x,m);
+  return r;
+}
+
+/* paramsmenu.h */
+/* pick one of these three: */
+#define SIZE761
+#undef SIZE653
+#undef SIZE857
+
+/* pick one of these two: */
+#define SNTRUP /* Streamlined NTRU Prime */
+#undef LPR /* NTRU LPRime */
+
+/* params.h */
+#ifndef params_H
+#define params_H
+
+/* menu of parameter choices: */
+
+
+/* what the menu means: */
+
+#if defined(SIZE761)
+#define p 761
+#define q 4591
+#define Rounded_bytes 1007
+#ifndef LPR
+#define Rq_bytes 1158
+#define w 286
+#else
+#define w 250
+#define tau0 2156
+#define tau1 114
+#define tau2 2007
+#define tau3 287
+#endif
+
+#elif defined(SIZE653)
+#define p 653
+#define q 4621
+#define Rounded_bytes 865
+#ifndef LPR
+#define Rq_bytes 994
+#define w 288
+#else
+#define w 252
+#define tau0 2175
+#define tau1 113
+#define tau2 2031
+#define tau3 290
+#endif
+
+#elif defined(SIZE857)
+#define p 857
+#define q 5167
+#define Rounded_bytes 1152
+#ifndef LPR
+#define Rq_bytes 1322
+#define w 322
+#else
+#define w 281
+#define tau0 2433
+#define tau1 101
+#define tau2 2265
+#define tau3 324
+#endif
+
+#else
+#error "no parameter set defined"
+#endif
+
+#ifdef LPR
+#define I 256
+#endif
+
+#endif
+
+/* Decode.c */
+
+static void Decode(uint16 *out,const unsigned char *S,const uint16 *M,long long len)
+{
+  if (len == 1) {
+    if (M[0] == 1)
+      *out = 0;
+    else if (M[0] <= 256)
+      *out = uint32_mod_uint14(S[0],M[0]);
+    else
+      *out = uint32_mod_uint14(S[0]+(((uint16)S[1])<<8),M[0]);
+  }
+  if (len > 1) {
+    uint16 R2[(len+1)/2];
+    uint16 M2[(len+1)/2];
+    uint16 bottomr[len/2];
+    uint32 bottomt[len/2];
+    long long i;
+    for (i = 0;i < len-1;i += 2) {
+      uint32 m = M[i]*(uint32) M[i+1];
+      if (m > 256*16383) {
+        bottomt[i/2] = 256*256;
+        bottomr[i/2] = S[0]+256*S[1];
+        S += 2;
+        M2[i/2] = (((m+255)>>8)+255)>>8;
+      } else if (m >= 16384) {
+        bottomt[i/2] = 256;
+        bottomr[i/2] = S[0];
+        S += 1;
+        M2[i/2] = (m+255)>>8;
+      } else {
+        bottomt[i/2] = 1;
+        bottomr[i/2] = 0;
+        M2[i/2] = m;
+      }
+    }
+    if (i < len)
+      M2[i/2] = M[i];
+    Decode(R2,S,M2,(len+1)/2);
+    for (i = 0;i < len-1;i += 2) {
+      uint32 r = bottomr[i/2];
+      uint32 r1;
+      uint16 r0;
+      r += bottomt[i/2]*R2[i/2];
+      uint32_divmod_uint14(&r1,&r0,r,M[i]);
+      r1 = uint32_mod_uint14(r1,M[i+1]); /* only needed for invalid inputs */
+      *out++ = r0;
+      *out++ = r1;
+    }
+    if (i < len)
+      *out++ = R2[i/2];
+  }
+}
+
+/* Encode.c */
+
+/* 0 <= R[i] < M[i] < 16384 */
+static void Encode(unsigned char *out,const uint16 *R,const uint16 *M,long long len)
+{
+  if (len == 1) {
+    uint16 r = R[0];
+    uint16 m = M[0];
+    while (m > 1) {
+      *out++ = r;
+      r >>= 8;
+      m = (m+255)>>8;
+    }
+  }
+  if (len > 1) {
+    uint16 R2[(len+1)/2];
+    uint16 M2[(len+1)/2];
+    long long i;
+    for (i = 0;i < len-1;i += 2) {
+      uint32 m0 = M[i];
+      uint32 r = R[i]+R[i+1]*m0;
+      uint32 m = M[i+1]*m0;
+      while (m >= 16384) {
+        *out++ = r;
+        r >>= 8;
+        m = (m+255)>>8;
+      }
+      R2[i/2] = r;
+      M2[i/2] = m;
+    }
+    if (i < len) {
+      R2[i/2] = R[i];
+      M2[i/2] = M[i];
+    }
+    Encode(out,R2,M2,(len+1)/2);
+  }
+}
+
+/* kem.c */
+
+#ifdef LPR
+#endif
+
+
+/* ----- masks */
+
+#ifndef LPR
+
+/* return -1 if x!=0; else return 0 */
+static int int16_nonzero_mask(int16 x)
+{
+  uint16 u = x; /* 0, else 1...65535 */
+  uint32 v = u; /* 0, else 1...65535 */
+  v = -v; /* 0, else 2^32-65535...2^32-1 */
+  v >>= 31; /* 0, else 1 */
+  return -v; /* 0, else -1 */
+}
+
+#endif
+
+/* return -1 if x<0; otherwise return 0 */
+static int int16_negative_mask(int16 x)
+{
+  uint16 u = x;
+  u >>= 15;
+  return -(int) u;
+  /* alternative with gcc -fwrapv: */
+  /* x>>15 compiles to CPU's arithmetic right shift */
+}
+
+/* ----- arithmetic mod 3 */
+
+typedef int8 small;
+
+/* F3 is always represented as -1,0,1 */
+/* so ZZ_fromF3 is a no-op */
+
+/* x must not be close to top int16 */
+static small F3_freeze(int16 x)
+{
+  return int32_mod_uint14(x+1,3)-1;
+}
+
+/* ----- arithmetic mod q */
+
+#define q12 ((q-1)/2)
+typedef int16 Fq;
+/* always represented as -q12...q12 */
+/* so ZZ_fromFq is a no-op */
+
+/* x must not be close to top int32 */
+static Fq Fq_freeze(int32 x)
+{
+  return int32_mod_uint14(x+q12,q)-q12;
+}
+
+#ifndef LPR
+
+static Fq Fq_recip(Fq a1)
+{ 
+  int i = 1;
+  Fq ai = a1;
+
+  while (i < q-2) {
+    ai = Fq_freeze(a1*(int32)ai);
+    i += 1;
+  }
+  return ai;
+} 
+
+#endif
+
+/* ----- Top and Right */
+
+#ifdef LPR
+#define tau 16
+
+static int8 Top(Fq C)
+{
+  return (tau1*(int32)(C+tau0)+16384)>>15;
+}
+
+static Fq Right(int8 T)
+{
+  return Fq_freeze(tau3*(int32)T-tau2);
+}
+#endif
+
+/* ----- small polynomials */
+
+#ifndef LPR
+
+/* 0 if Weightw_is(r), else -1 */
+static int Weightw_mask(small *r)
+{
+  int weight = 0;
+  int i;
+
+  for (i = 0;i < p;++i) weight += r[i]&1;
+  return int16_nonzero_mask(weight-w);
+}
+
+/* R3_fromR(R_fromRq(r)) */
+static void R3_fromRq(small *out,const Fq *r)
+{
+  int i;
+  for (i = 0;i < p;++i) out[i] = F3_freeze(r[i]);
+}
+
+/* h = f*g in the ring R3 */
+static void R3_mult(small *h,const small *f,const small *g)
+{
+  small fg[p+p-1];
+  small result;
+  int i,j;
+
+  for (i = 0;i < p;++i) {
+    result = 0;
+    for (j = 0;j <= i;++j) result = F3_freeze(result+f[j]*g[i-j]);
+    fg[i] = result;
+  }
+  for (i = p;i < p+p-1;++i) {
+    result = 0;
+    for (j = i-p+1;j < p;++j) result = F3_freeze(result+f[j]*g[i-j]);
+    fg[i] = result;
+  }
+
+  for (i = p+p-2;i >= p;--i) {
+    fg[i-p] = F3_freeze(fg[i-p]+fg[i]);
+    fg[i-p+1] = F3_freeze(fg[i-p+1]+fg[i]);
+  }
+
+  for (i = 0;i < p;++i) h[i] = fg[i];
+}
+
+/* returns 0 if recip succeeded; else -1 */
+static int R3_recip(small *out,const small *in)
+{ 
+  small f[p+1],g[p+1],v[p+1],r[p+1];
+  int i,loop,delta;
+  int sign,swap,t;
+  
+  for (i = 0;i < p+1;++i) v[i] = 0;
+  for (i = 0;i < p+1;++i) r[i] = 0;
+  r[0] = 1;
+  for (i = 0;i < p;++i) f[i] = 0;
+  f[0] = 1; f[p-1] = f[p] = -1;
+  for (i = 0;i < p;++i) g[p-1-i] = in[i];
+  g[p] = 0;
+    
+  delta = 1; 
+
+  for (loop = 0;loop < 2*p-1;++loop) {
+    for (i = p;i > 0;--i) v[i] = v[i-1];
+    v[0] = 0;
+    
+    sign = -g[0]*f[0];
+    swap = int16_negative_mask(-delta) & int16_nonzero_mask(g[0]);
+    delta ^= swap&(delta^-delta);
+    delta += 1;
+    
+    for (i = 0;i < p+1;++i) {
+      t = swap&(f[i]^g[i]); f[i] ^= t; g[i] ^= t;
+      t = swap&(v[i]^r[i]); v[i] ^= t; r[i] ^= t;
+    }
+  
+    for (i = 0;i < p+1;++i) g[i] = F3_freeze(g[i]+sign*f[i]);
+    for (i = 0;i < p+1;++i) r[i] = F3_freeze(r[i]+sign*v[i]);
+
+    for (i = 0;i < p;++i) g[i] = g[i+1];
+    g[p] = 0;
+  }
+  
+  sign = f[0];
+  for (i = 0;i < p;++i) out[i] = sign*v[p-1-i];
+  
+  return int16_nonzero_mask(delta);
+} 
+
+#endif
+
+/* ----- polynomials mod q */
+
+/* h = f*g in the ring Rq */
+static void Rq_mult_small(Fq *h,const Fq *f,const small *g)
+{
+  Fq fg[p+p-1];
+  Fq result;
+  int i,j;
+
+  for (i = 0;i < p;++i) {
+    result = 0;
+    for (j = 0;j <= i;++j) result = Fq_freeze(result+f[j]*(int32)g[i-j]);
+    fg[i] = result;
+  }
+  for (i = p;i < p+p-1;++i) {
+    result = 0;
+    for (j = i-p+1;j < p;++j) result = Fq_freeze(result+f[j]*(int32)g[i-j]);
+    fg[i] = result;
+  }
+
+  for (i = p+p-2;i >= p;--i) {
+    fg[i-p] = Fq_freeze(fg[i-p]+fg[i]);
+    fg[i-p+1] = Fq_freeze(fg[i-p+1]+fg[i]);
+  }
+
+  for (i = 0;i < p;++i) h[i] = fg[i];
+}
+
+#ifndef LPR
+
+/* h = 3f in Rq */
+static void Rq_mult3(Fq *h,const Fq *f)
+{
+  int i;
+  
+  for (i = 0;i < p;++i) h[i] = Fq_freeze(3*f[i]);
+}
+
+/* out = 1/(3*in) in Rq */
+/* returns 0 if recip succeeded; else -1 */
+static int Rq_recip3(Fq *out,const small *in)
+{ 
+  Fq f[p+1],g[p+1],v[p+1],r[p+1];
+  int i,loop,delta;
+  int swap,t;
+  int32 f0,g0;
+  Fq scale;
+
+  for (i = 0;i < p+1;++i) v[i] = 0;
+  for (i = 0;i < p+1;++i) r[i] = 0;
+  r[0] = Fq_recip(3);
+  for (i = 0;i < p;++i) f[i] = 0;
+  f[0] = 1; f[p-1] = f[p] = -1;
+  for (i = 0;i < p;++i) g[p-1-i] = in[i];
+  g[p] = 0;
+
+  delta = 1;
+
+  for (loop = 0;loop < 2*p-1;++loop) {
+    for (i = p;i > 0;--i) v[i] = v[i-1];
+    v[0] = 0;
+
+    swap = int16_negative_mask(-delta) & int16_nonzero_mask(g[0]);
+    delta ^= swap&(delta^-delta);
+    delta += 1;
+
+    for (i = 0;i < p+1;++i) {
+      t = swap&(f[i]^g[i]); f[i] ^= t; g[i] ^= t;
+      t = swap&(v[i]^r[i]); v[i] ^= t; r[i] ^= t;
+    }
+
+    f0 = f[0];
+    g0 = g[0];
+    for (i = 0;i < p+1;++i) g[i] = Fq_freeze(f0*g[i]-g0*f[i]);
+    for (i = 0;i < p+1;++i) r[i] = Fq_freeze(f0*r[i]-g0*v[i]);
+
+    for (i = 0;i < p;++i) g[i] = g[i+1];
+    g[p] = 0;
+  }
+
+  scale = Fq_recip(f[0]);
+  for (i = 0;i < p;++i) out[i] = Fq_freeze(scale*(int32)v[p-1-i]);
+
+  return int16_nonzero_mask(delta);
+}
+
+#endif
+
+/* ----- rounded polynomials mod q */
+
+static void Round(Fq *out,const Fq *a)
+{
+  int i;
+  for (i = 0;i < p;++i) out[i] = a[i]-F3_freeze(a[i]);
+}
+
+/* ----- sorting to generate short polynomial */
+
+static void Short_fromlist(small *out,const uint32 *in)
+{
+  uint32 L[p];
+  int i;
+
+  for (i = 0;i < w;++i) L[i] = in[i]&(uint32)-2;
+  for (i = w;i < p;++i) L[i] = (in[i]&(uint32)-3)|1;
+  crypto_sort_uint32(L,p);
+  for (i = 0;i < p;++i) out[i] = (L[i]&3)-1;
+}
+
+/* ----- underlying hash function */
+
+#define Hash_bytes 32
+
+/* e.g., b = 0 means out = Hash0(in) */
+static void Hash_prefix(unsigned char *out,int b,const unsigned char *in,int inlen)
+{
+  unsigned char x[inlen+1];
+  unsigned char h[64];
+  int i;
+
+  x[0] = b;
+  for (i = 0;i < inlen;++i) x[i+1] = in[i];
+  crypto_hash_sha512(h,x,inlen+1);
+  for (i = 0;i < 32;++i) out[i] = h[i];
+}
+
+/* ----- higher-level randomness */
+
+static uint32 urandom32(void)
+{
+  unsigned char c[4];
+  uint32 out[4];
+
+  randombytes(c,4);
+  out[0] = (uint32)c[0];
+  out[1] = ((uint32)c[1])<<8;
+  out[2] = ((uint32)c[2])<<16;
+  out[3] = ((uint32)c[3])<<24;
+  return out[0]+out[1]+out[2]+out[3];
+}
+
+static void Short_random(small *out)
+{
+  uint32 L[p];
+  int i;
+
+  for (i = 0;i < p;++i) L[i] = urandom32();
+  Short_fromlist(out,L);
+}
+
+#ifndef LPR
+
+static void Small_random(small *out)
+{
+  int i;
+
+  for (i = 0;i < p;++i) out[i] = (((urandom32()&0x3fffffff)*3)>>30)-1;
+}
+
+#endif
+
+/* ----- Streamlined NTRU Prime Core */
+
+#ifndef LPR
+
+/* h,(f,ginv) = KeyGen() */
+static void KeyGen(Fq *h,small *f,small *ginv)
+{
+  small g[p];
+  Fq finv[p];
+  
+  for (;;) {
+    Small_random(g);
+    if (R3_recip(ginv,g) == 0) break;
+  }
+  Short_random(f);
+  Rq_recip3(finv,f); /* always works */
+  Rq_mult_small(h,finv,g);
+}
+
+/* c = Encrypt(r,h) */
+static void Encrypt(Fq *c,const small *r,const Fq *h)
+{
+  Fq hr[p];
+
+  Rq_mult_small(hr,h,r);
+  Round(c,hr);
+}
+
+/* r = Decrypt(c,(f,ginv)) */
+static void Decrypt(small *r,const Fq *c,const small *f,const small *ginv)
+{
+  Fq cf[p];
+  Fq cf3[p];
+  small e[p];
+  small ev[p];
+  int mask;
+  int i;
+
+  Rq_mult_small(cf,c,f);
+  Rq_mult3(cf3,cf);
+  R3_fromRq(e,cf3);
+  R3_mult(ev,e,ginv);
+
+  mask = Weightw_mask(ev); /* 0 if weight w, else -1 */
+  for (i = 0;i < w;++i) r[i] = ((ev[i]^1)&~mask)^1;
+  for (i = w;i < p;++i) r[i] = ev[i]&~mask;
+}
+  
+#endif
+
+/* ----- NTRU LPRime Core */
+
+#ifdef LPR
+
+/* (G,A),a = KeyGen(G); leaves G unchanged */
+static void KeyGen(Fq *A,small *a,const Fq *G)
+{
+  Fq aG[p];
+
+  Short_random(a);
+  Rq_mult_small(aG,G,a);
+  Round(A,aG);
+}
+
+/* B,T = Encrypt(r,(G,A),b) */
+static void Encrypt(Fq *B,int8 *T,const int8 *r,const Fq *G,const Fq *A,const small *b)
+{
+  Fq bG[p];
+  Fq bA[p];
+  int i;
+
+  Rq_mult_small(bG,G,b);
+  Round(B,bG);
+  Rq_mult_small(bA,A,b);
+  for (i = 0;i < I;++i) T[i] = Top(Fq_freeze(bA[i]+r[i]*q12));
+}
+
+/* r = Decrypt((B,T),a) */
+static void Decrypt(int8 *r,const Fq *B,const int8 *T,const small *a)
+{
+  Fq aB[p];
+  int i;
+
+  Rq_mult_small(aB,B,a);
+  for (i = 0;i < I;++i)
+    r[i] = -int16_negative_mask(Fq_freeze(Right(T[i])-aB[i]+4*w+1));
+}
+    
+#endif
+
+/* ----- encoding I-bit inputs */
+
+#ifdef LPR
+
+#define Inputs_bytes (I/8)
+typedef int8 Inputs[I]; /* passed by reference */
+
+static void Inputs_encode(unsigned char *s,const Inputs r)
+{
+  int i;
+  for (i = 0;i < Inputs_bytes;++i) s[i] = 0;
+  for (i = 0;i < I;++i) s[i>>3] |= r[i]<<(i&7);
+}
+
+#endif
+
+/* ----- Expand */
+
+#ifdef LPR
+
+static const unsigned char aes_nonce[16] = {0};
+
+static void Expand(uint32 *L,const unsigned char *k)
+{
+  int i;
+  crypto_stream_aes256ctr((unsigned char *) L,4*p,aes_nonce,k);
+  for (i = 0;i < p;++i) {
+    uint32 L0 = ((unsigned char *) L)[4*i];
+    uint32 L1 = ((unsigned char *) L)[4*i+1];
+    uint32 L2 = ((unsigned char *) L)[4*i+2];
+    uint32 L3 = ((unsigned char *) L)[4*i+3];
+    L[i] = L0+(L1<<8)+(L2<<16)+(L3<<24);
+  }
+}
+
+#endif
+
+/* ----- Seeds */
+
+#ifdef LPR
+
+#define Seeds_bytes 32
+
+static void Seeds_random(unsigned char *s)
+{
+  randombytes(s,Seeds_bytes);
+}
+
+#endif
+
+/* ----- Generator, HashShort */
+
+#ifdef LPR
+
+/* G = Generator(k) */
+static void Generator(Fq *G,const unsigned char *k)
+{
+  uint32 L[p];
+  int i;
+
+  Expand(L,k);
+  for (i = 0;i < p;++i) G[i] = uint32_mod_uint14(L[i],q)-q12;
+}
+
+/* out = HashShort(r) */
+static void HashShort(small *out,const Inputs r)
+{
+  unsigned char s[Inputs_bytes];
+  unsigned char h[Hash_bytes];
+  uint32 L[p];
+
+  Inputs_encode(s,r);
+  Hash_prefix(h,5,s,sizeof s);
+  Expand(L,h);
+  Short_fromlist(out,L);
+}
+
+#endif
+  
+/* ----- NTRU LPRime Expand */
+
+#ifdef LPR
+
+/* (S,A),a = XKeyGen() */
+static void XKeyGen(unsigned char *S,Fq *A,small *a)
+{
+  Fq G[p];
+
+  Seeds_random(S);
+  Generator(G,S);
+  KeyGen(A,a,G);
+}
+
+/* B,T = XEncrypt(r,(S,A)) */
+static void XEncrypt(Fq *B,int8 *T,const int8 *r,const unsigned char *S,const Fq *A)
+{
+  Fq G[p];
+  small b[p];
+
+  Generator(G,S);
+  HashShort(b,r);
+  Encrypt(B,T,r,G,A,b);
+}
+
+#define XDecrypt Decrypt
+
+#endif
+
+/* ----- encoding small polynomials (including short polynomials) */
+
+#define Small_bytes ((p+3)/4)
+
+/* these are the only functions that rely on p mod 4 = 1 */
+
+static void Small_encode(unsigned char *s,const small *f)
+{
+  small x;
+  int i;
+
+  for (i = 0;i < p/4;++i) {
+    x = *f++ + 1;
+    x += (*f++ + 1)<<2;
+    x += (*f++ + 1)<<4;
+    x += (*f++ + 1)<<6;
+    *s++ = x;
+  }
+  x = *f++ + 1;
+  *s++ = x;
+}
+
+static void Small_decode(small *f,const unsigned char *s)
+{
+  unsigned char x;
+  int i;
+
+  for (i = 0;i < p/4;++i) {
+    x = *s++;
+    *f++ = ((small)(x&3))-1; x >>= 2;
+    *f++ = ((small)(x&3))-1; x >>= 2;
+    *f++ = ((small)(x&3))-1; x >>= 2;
+    *f++ = ((small)(x&3))-1;
+  }
+  x = *s++;
+  *f++ = ((small)(x&3))-1;
+}
+
+/* ----- encoding general polynomials */
+
+#ifndef LPR
+
+static void Rq_encode(unsigned char *s,const Fq *r)
+{
+  uint16 R[p],M[p];
+  int i;
+  
+  for (i = 0;i < p;++i) R[i] = r[i]+q12;
+  for (i = 0;i < p;++i) M[i] = q;
+  Encode(s,R,M,p);
+}
+
+static void Rq_decode(Fq *r,const unsigned char *s)
+{
+  uint16 R[p],M[p];
+  int i;
+
+  for (i = 0;i < p;++i) M[i] = q;
+  Decode(R,s,M,p);
+  for (i = 0;i < p;++i) r[i] = ((Fq)R[i])-q12;
+}
+  
+#endif
+
+/* ----- encoding rounded polynomials */
+
+static void Rounded_encode(unsigned char *s,const Fq *r)
+{
+  uint16 R[p],M[p];
+  int i;
+
+  for (i = 0;i < p;++i) R[i] = ((r[i]+q12)*10923)>>15;
+  for (i = 0;i < p;++i) M[i] = (q+2)/3;
+  Encode(s,R,M,p);
+}
+
+static void Rounded_decode(Fq *r,const unsigned char *s)
+{
+  uint16 R[p],M[p];
+  int i;
+
+  for (i = 0;i < p;++i) M[i] = (q+2)/3;
+  Decode(R,s,M,p);
+  for (i = 0;i < p;++i) r[i] = R[i]*3-q12;
+}
+
+/* ----- encoding top polynomials */
+
+#ifdef LPR
+
+#define Top_bytes (I/2)
+
+static void Top_encode(unsigned char *s,const int8 *T)
+{
+  int i;
+  for (i = 0;i < Top_bytes;++i)
+    s[i] = T[2*i]+(T[2*i+1]<<4);
+}
+
+static void Top_decode(int8 *T,const unsigned char *s)
+{
+  int i;
+  for (i = 0;i < Top_bytes;++i) {
+    T[2*i] = s[i]&15;
+    T[2*i+1] = s[i]>>4;
+  }
+}
+
+#endif
+
+/* ----- Streamlined NTRU Prime Core plus encoding */
+
+#ifndef LPR
+
+typedef small Inputs[p]; /* passed by reference */
+#define Inputs_random Short_random
+#define Inputs_encode Small_encode
+#define Inputs_bytes Small_bytes
+
+#define Ciphertexts_bytes Rounded_bytes
+#define SecretKeys_bytes (2*Small_bytes)
+#define PublicKeys_bytes Rq_bytes
+
+/* pk,sk = ZKeyGen() */
+static void ZKeyGen(unsigned char *pk,unsigned char *sk)
+{
+  Fq h[p];
+  small f[p],v[p];
+
+  KeyGen(h,f,v);
+  Rq_encode(pk,h);
+  Small_encode(sk,f); sk += Small_bytes;
+  Small_encode(sk,v);
+}
+
+/* C = ZEncrypt(r,pk) */
+static void ZEncrypt(unsigned char *C,const Inputs r,const unsigned char *pk)
+{
+  Fq h[p];
+  Fq c[p];
+  Rq_decode(h,pk);
+  Encrypt(c,r,h);
+  Rounded_encode(C,c);
+}
+
+/* r = ZDecrypt(C,sk) */
+static void ZDecrypt(Inputs r,const unsigned char *C,const unsigned char *sk)
+{
+  small f[p],v[p];
+  Fq c[p];
+
+  Small_decode(f,sk); sk += Small_bytes;
+  Small_decode(v,sk);
+  Rounded_decode(c,C);
+  Decrypt(r,c,f,v);
+}
+
+#endif
+
+/* ----- NTRU LPRime Expand plus encoding */
+
+#ifdef LPR
+
+#define Ciphertexts_bytes (Rounded_bytes+Top_bytes)
+#define SecretKeys_bytes Small_bytes
+#define PublicKeys_bytes (Seeds_bytes+Rounded_bytes)
+
+static void Inputs_random(Inputs r)
+{
+  unsigned char s[Inputs_bytes];
+  int i;
+
+  randombytes(s,sizeof s);
+  for (i = 0;i < I;++i) r[i] = 1&(s[i>>3]>>(i&7));
+}
+
+/* pk,sk = ZKeyGen() */
+static void ZKeyGen(unsigned char *pk,unsigned char *sk)
+{
+  Fq A[p];
+  small a[p];
+
+  XKeyGen(pk,A,a); pk += Seeds_bytes;
+  Rounded_encode(pk,A);
+  Small_encode(sk,a);
+}
+
+/* c = ZEncrypt(r,pk) */
+static void ZEncrypt(unsigned char *c,const Inputs r,const unsigned char *pk)
+{
+  Fq A[p];
+  Fq B[p];
+  int8 T[I];
+
+  Rounded_decode(A,pk+Seeds_bytes);
+  XEncrypt(B,T,r,pk,A);
+  Rounded_encode(c,B); c += Rounded_bytes;
+  Top_encode(c,T);
+}
+
+/* r = ZDecrypt(C,sk) */
+static void ZDecrypt(Inputs r,const unsigned char *c,const unsigned char *sk)
+{
+  small a[p];
+  Fq B[p];
+  int8 T[I];
+
+  Small_decode(a,sk);
+  Rounded_decode(B,c);
+  Top_decode(T,c+Rounded_bytes);
+  XDecrypt(r,B,T,a);
+}
+
+#endif
+
+/* ----- confirmation hash */
+
+#define Confirm_bytes 32
+
+/* h = HashConfirm(r,pk,cache); cache is Hash4(pk) */
+static void HashConfirm(unsigned char *h,const unsigned char *r,const unsigned char *pk,const unsigned char *cache)
+{
+#ifndef LPR
+  unsigned char x[Hash_bytes*2];
+  int i;
+
+  Hash_prefix(x,3,r,Inputs_bytes);
+  for (i = 0;i < Hash_bytes;++i) x[Hash_bytes+i] = cache[i];
+#else
+  unsigned char x[Inputs_bytes+Hash_bytes];
+  int i;
+
+  for (i = 0;i < Inputs_bytes;++i) x[i] = r[i];
+  for (i = 0;i < Hash_bytes;++i) x[Inputs_bytes+i] = cache[i];
+#endif
+  Hash_prefix(h,2,x,sizeof x);
+}
+
+/* ----- session-key hash */
+
+/* k = HashSession(b,y,z) */
+static void HashSession(unsigned char *k,int b,const unsigned char *y,const unsigned char *z)
+{
+#ifndef LPR
+  unsigned char x[Hash_bytes+Ciphertexts_bytes+Confirm_bytes];
+  int i;
+
+  Hash_prefix(x,3,y,Inputs_bytes);
+  for (i = 0;i < Ciphertexts_bytes+Confirm_bytes;++i) x[Hash_bytes+i] = z[i];
+#else
+  unsigned char x[Inputs_bytes+Ciphertexts_bytes+Confirm_bytes];
+  int i;
+
+  for (i = 0;i < Inputs_bytes;++i) x[i] = y[i];
+  for (i = 0;i < Ciphertexts_bytes+Confirm_bytes;++i) x[Inputs_bytes+i] = z[i];
+#endif
+  Hash_prefix(k,b,x,sizeof x);
+}
+
+/* ----- Streamlined NTRU Prime and NTRU LPRime */
+
+/* pk,sk = KEM_KeyGen() */
+static void KEM_KeyGen(unsigned char *pk,unsigned char *sk)
+{
+  int i;
+
+  ZKeyGen(pk,sk); sk += SecretKeys_bytes;
+  for (i = 0;i < PublicKeys_bytes;++i) *sk++ = pk[i];
+  randombytes(sk,Inputs_bytes); sk += Inputs_bytes;
+  Hash_prefix(sk,4,pk,PublicKeys_bytes);
+}
+
+/* c,r_enc = Hide(r,pk,cache); cache is Hash4(pk) */
+static void Hide(unsigned char *c,unsigned char *r_enc,const Inputs r,const unsigned char *pk,const unsigned char *cache)
+{
+  Inputs_encode(r_enc,r);
+  ZEncrypt(c,r,pk); c += Ciphertexts_bytes;
+  HashConfirm(c,r_enc,pk,cache);
+}
+
+/* c,k = Encap(pk) */
+static void Encap(unsigned char *c,unsigned char *k,const unsigned char *pk)
+{
+  Inputs r;
+  unsigned char r_enc[Inputs_bytes];
+  unsigned char cache[Hash_bytes];
+
+  Hash_prefix(cache,4,pk,PublicKeys_bytes);
+  Inputs_random(r);
+  Hide(c,r_enc,r,pk,cache);
+  HashSession(k,1,r_enc,c);
+}
+
+/* 0 if matching ciphertext+confirm, else -1 */
+static int Ciphertexts_diff_mask(const unsigned char *c,const unsigned char *c2)
+{
+  uint16 differentbits = 0;
+  int len = Ciphertexts_bytes+Confirm_bytes;
+
+  while (len-- > 0) differentbits |= (*c++)^(*c2++);
+  return (1&((differentbits-1)>>8))-1;
+}
+
+/* k = Decap(c,sk) */
+static void Decap(unsigned char *k,const unsigned char *c,const unsigned char *sk)
+{
+  const unsigned char *pk = sk + SecretKeys_bytes;
+  const unsigned char *rho = pk + PublicKeys_bytes;
+  const unsigned char *cache = rho + Inputs_bytes;
+  Inputs r;
+  unsigned char r_enc[Inputs_bytes];
+  unsigned char cnew[Ciphertexts_bytes+Confirm_bytes];
+  int mask;
+  int i;
+
+  ZDecrypt(r,c,sk);
+  Hide(cnew,r_enc,r,pk,cache);
+  mask = Ciphertexts_diff_mask(c,cnew);
+  for (i = 0;i < Inputs_bytes;++i) r_enc[i] ^= mask&(r_enc[i]^rho[i]);
+  HashSession(k,1+mask,r_enc,c);
+}
+
+/* ----- crypto_kem_sntrup761_tinyssh API */
+
+
+int crypto_kem_sntrup761_tinyssh_keypair(unsigned char *pk,unsigned char *sk)
+{
+  KEM_KeyGen(pk,sk);
+  return 0;
+}
+
+int crypto_kem_sntrup761_tinyssh_enc(unsigned char *c,unsigned char *k,const unsigned char *pk)
+{
+  Encap(c,k,pk);
+  return 0;
+}
+
+int crypto_kem_sntrup761_tinyssh_dec(unsigned char *k,const unsigned char *c,const unsigned char *sk)
+{
+  Decap(k,c,sk);
+  return 0;
+}
+
+
+#if 0
+Script used to merge into single the file:
+
+#!/bin/sh
+
+rm crypto_kem_sntrup761.c || :
+
+(
+  cd "$1"
+
+  echo '/*'
+  echo 'Original code: supercop-20210125/crypto_kem/sntrup761/ref'
+  echo 'Modifications (Jan Mojzis):'
+  echo '- source code merged into single file'
+  echo '- crypto_kem renamed to crypto_kem_sntrup761_tinyssh'
+  echo '*/'
+  echo
+  echo '/* See https://ntruprime.cr.yp.to/software.html for detailed documentation. */'
+  echo
+  echo '#include <string.h>'
+  echo '#include "crypto_uint64.h"'
+  echo '#include "crypto_uint32.h"'
+  echo '#include "crypto_uint16.h"'
+  echo '#include "crypto_int32.h"'
+  echo '#include "crypto_int16.h"'
+  echo '#include "crypto_int8.h"'
+  echo '#include "randombytes.h"'
+  echo '#include "crypto_verify_32.h"'
+  echo '#include "crypto_sort_uint32.h"'
+  echo '#include "crypto_hash_sha512.h"'
+  echo '#include "crypto_kem_sntrup761.h"'
+  echo ''
+  echo '#define uint64 crypto_uint64'
+  echo '#define uint32 crypto_uint32'
+  echo '#define uint16 crypto_uint16'
+  echo '#define int32 crypto_int32'
+  echo '#define int16 crypto_int16'
+  echo '#define int8 crypto_int8'
+  echo
+
+  (
+    for f in  uint32.c int32.c paramsmenu.h params.h Decode.c Encode.c; do
+      echo "/* ${f} */"
+      cat "${f}" | sed 's/^void /static void /' | sed 's/^int16 /static int16 /'
+      echo
+    done | grep -v '#include'
+  )
+
+  (
+    echo '/* kem.c */'
+    cat kem.c
+    echo
+  ) | grep -v '#include' | sed 's/crypto_kem/crypto_kem_sntrup761_tinyssh/g'
+
+  echo
+  echo '#if 0'
+  echo 'Script used to merge into single the file:'
+  echo
+  cat $0
+  echo
+  echo '#endif'
+
+) > crypto_kem_sntrup761.c.tmp
+mv -f crypto_kem_sntrup761.c.tmp crypto_kem_sntrup761.c
+
+#endif
diff -pruN 20190101-1/crypto/crypto_kem_sntrup761.h 20220801-1/crypto/crypto_kem_sntrup761.h
--- 20190101-1/crypto/crypto_kem_sntrup761.h	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup761.h	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,22 @@
+#ifndef crypto_kem_sntrup761_H
+#define crypto_kem_sntrup761_H
+
+#define crypto_kem_sntrup761_tinyssh_SECRETKEYBYTES 1763
+#define crypto_kem_sntrup761_tinyssh_PUBLICKEYBYTES 1158
+#define crypto_kem_sntrup761_tinyssh_CIPHERTEXTBYTES 1039
+#define crypto_kem_sntrup761_tinyssh_BYTES 32
+extern int crypto_kem_sntrup761_tinyssh_keypair(unsigned char *, unsigned char *);
+extern int crypto_kem_sntrup761_tinyssh_enc(unsigned char *, unsigned char *, const unsigned char *);
+extern int crypto_kem_sntrup761_tinyssh_dec(unsigned char *, const unsigned char *, const unsigned char *);
+
+#define crypto_kem_sntrup761_keypair crypto_kem_sntrup761_tinyssh_keypair
+#define crypto_kem_sntrup761_enc crypto_kem_sntrup761_tinyssh_enc
+#define crypto_kem_sntrup761_dec crypto_kem_sntrup761_tinyssh_dec
+#define crypto_kem_sntrup761_SECRETKEYBYTES crypto_kem_sntrup761_tinyssh_SECRETKEYBYTES
+#define crypto_kem_sntrup761_PUBLICKEYBYTES crypto_kem_sntrup761_tinyssh_PUBLICKEYBYTES
+#define crypto_kem_sntrup761_CIPHERTEXTBYTES crypto_kem_sntrup761_tinyssh_CIPHERTEXTBYTES
+#define crypto_kem_sntrup761_BYTES crypto_kem_sntrup761_tinyssh_BYTES
+#define crypto_kem_sntrup761_IMPLEMENTATION "tinyssh"
+#define crypto_kem_sntrup761_VERSION "-"
+
+#endif
diff -pruN 20190101-1/crypto/crypto_kem_sntrup761x25519.c 20220801-1/crypto/crypto_kem_sntrup761x25519.c
--- 20190101-1/crypto/crypto_kem_sntrup761x25519.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup761x25519.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,120 @@
+/*
+20210314
+Jan Mojzis
+Public domain.
+*/
+
+#include "randombytes.h"
+#include "cleanup.h"
+#include "crypto_hash_sha512.h"
+#include "crypto_scalarmult_curve25519.h"
+#include "crypto_kem_sntrup761.h"
+#include "crypto_kem_sntrup761x25519.h"
+
+#define sntrup761_BYTES crypto_kem_sntrup761_BYTES
+#define x25519_BYTES crypto_scalarmult_curve25519_BYTES
+#define x25519_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES
+#define sx_BYTES sntrup761_BYTES + x25519_BYTES
+#define sntrup761_PUBLICKEYBYTES crypto_kem_sntrup761_PUBLICKEYBYTES
+#define sntrup761_SECRETKEYBYTES crypto_kem_sntrup761_SECRETKEYBYTES
+#define sx_PUBLICKEYBYTES sntrup761_PUBLICKEYBYTES + x25519_BYTES
+#define sx_SECRETKEYBYTES sntrup761_SECRETKEYBYTES + x25519_SCALARBYTES
+
+static unsigned char returnmask(int x) {
+
+    unsigned long long ret = 1ULL;
+    ret <<= 8 * sizeof(int);
+    ret -= (unsigned long long)(unsigned int)x;
+    ret >>= 8 * sizeof(int);
+    return ret - 1;
+}
+
+int crypto_kem_sntrup761x25519_tinyssh_enc(unsigned char *c,
+                                            unsigned char *k,
+                                            const unsigned char *pk) {
+
+    int r = 0;
+    long long i;
+    unsigned char onetimesk[x25519_SCALARBYTES];
+    unsigned char buf[sx_BYTES];
+    unsigned char tmp[sx_BYTES];
+    unsigned char b;
+
+    /* sntrup761 */
+    r |= crypto_kem_sntrup761_enc(c, buf, pk);
+    pk += crypto_kem_sntrup761_PUBLICKEYBYTES;
+    c += crypto_kem_sntrup761_CIPHERTEXTBYTES;
+
+    /* x25519 */
+    randombytes(onetimesk, sizeof onetimesk);
+    r |= crypto_scalarmult_curve25519_base(/*onetimepk*/ c, onetimesk);
+    r |= crypto_scalarmult_curve25519(buf + sntrup761_BYTES, onetimesk, pk);
+
+    /* if something fails, fill the buffer with random data */
+    randombytes(tmp, sizeof tmp);
+    b = returnmask(r);
+    for (i = 0; i < sx_BYTES; ++i) tmp[i] = b & (tmp[i] ^ buf[i]);
+    for (i = 0; i < sx_BYTES; ++i) buf[i] ^= tmp[i];
+
+    /* hash together sntrup459176 KEM-key and x25519 shared secret */
+    crypto_hash_sha512(k, buf, sizeof buf);
+
+    /* cleanup */
+    cleanup(buf);
+    cleanup(onetimesk);
+    return r;
+}
+
+int crypto_kem_sntrup761x25519_tinyssh_dec(unsigned char *k,
+                                            const unsigned char *c,
+                                            const unsigned char *sk) {
+
+    int r = 0;
+    long long i;
+    unsigned char buf[sx_BYTES];
+    unsigned char tmp[sx_BYTES];
+    unsigned char b;
+
+    /* sntrup761 */
+    r |= crypto_kem_sntrup761_dec(buf, c, sk);
+    sk += crypto_kem_sntrup761_SECRETKEYBYTES;
+    c += crypto_kem_sntrup761_CIPHERTEXTBYTES;
+
+    /* x25519 */
+    r |= crypto_scalarmult_curve25519(buf + sntrup761_BYTES, sk, c);
+
+    /* if something fails, fill the buffer with random data */
+    randombytes(tmp, sizeof tmp);
+    b = returnmask(r);
+    for (i = 0; i < sx_BYTES; ++i) tmp[i] = b & (tmp[i] ^ buf[i]);
+    for (i = 0; i < sx_BYTES; ++i) buf[i] ^= tmp[i];
+
+    /* hash together sntrup459176 KEM-key and x25519 shared secret */
+    crypto_hash_sha512(k, buf, sizeof buf);
+
+    /* cleanup */
+    cleanup(buf);
+    return r;
+}
+
+int crypto_kem_sntrup761x25519_tinyssh_keypair(unsigned char *pk,
+                                                unsigned char *sk) {
+
+    int r = 0;
+    long long i;
+    unsigned char b;
+
+    /* sntrup761 */
+    r |= crypto_kem_sntrup761_keypair(pk, sk);
+
+    /* x25519 */
+    randombytes(sk + sntrup761_SECRETKEYBYTES, x25519_SCALARBYTES);
+    r |= crypto_scalarmult_curve25519_base(pk + sntrup761_PUBLICKEYBYTES,
+                                           sk + sntrup761_SECRETKEYBYTES);
+
+    b = ~returnmask(r);
+    for (i = 0; i < sx_PUBLICKEYBYTES; ++i) pk[i] &= b;
+    for (i = 0; i < sx_SECRETKEYBYTES; ++i) sk[i] &= b;
+
+    return r;
+}
diff -pruN 20190101-1/crypto/crypto_kem_sntrup761x25519.h 20220801-1/crypto/crypto_kem_sntrup761x25519.h
--- 20190101-1/crypto/crypto_kem_sntrup761x25519.h	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto/crypto_kem_sntrup761x25519.h	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,22 @@
+#ifndef crypto_kem_sntrup761x25519_H
+#define crypto_kem_sntrup761x25519_H
+
+#define crypto_kem_sntrup761x25519_tinyssh_SECRETKEYBYTES 1795
+#define crypto_kem_sntrup761x25519_tinyssh_PUBLICKEYBYTES 1190
+#define crypto_kem_sntrup761x25519_tinyssh_CIPHERTEXTBYTES 1071
+#define crypto_kem_sntrup761x25519_tinyssh_BYTES 64
+extern int crypto_kem_sntrup761x25519_tinyssh_keypair(unsigned char *, unsigned char *);
+extern int crypto_kem_sntrup761x25519_tinyssh_enc(unsigned char *, unsigned char *, const unsigned char *);
+extern int crypto_kem_sntrup761x25519_tinyssh_dec(unsigned char *, const unsigned char *, const unsigned char *);
+
+#define crypto_kem_sntrup761x25519_keypair crypto_kem_sntrup761x25519_tinyssh_keypair
+#define crypto_kem_sntrup761x25519_enc crypto_kem_sntrup761x25519_tinyssh_enc
+#define crypto_kem_sntrup761x25519_dec crypto_kem_sntrup761x25519_tinyssh_dec
+#define crypto_kem_sntrup761x25519_SECRETKEYBYTES crypto_kem_sntrup761x25519_tinyssh_SECRETKEYBYTES
+#define crypto_kem_sntrup761x25519_PUBLICKEYBYTES crypto_kem_sntrup761x25519_tinyssh_PUBLICKEYBYTES
+#define crypto_kem_sntrup761x25519_CIPHERTEXTBYTES crypto_kem_sntrup761x25519_tinyssh_CIPHERTEXTBYTES
+#define crypto_kem_sntrup761x25519_BYTES crypto_kem_sntrup761x25519_tinyssh_BYTES
+#define crypto_kem_sntrup761x25519_IMPLEMENTATION "tinyssh"
+#define crypto_kem_sntrup761x25519_VERSION "-"
+
+#endif
diff -pruN 20190101-1/crypto/CRYPTOLIBS 20220801-1/crypto/CRYPTOLIBS
--- 20190101-1/crypto/CRYPTOLIBS	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/CRYPTOLIBS	2022-07-17 07:30:14.000000000 +0000
@@ -17,5 +17,6 @@ sc25519.o
 crypto_scalarmult_curve25519.o
 crypto_sign_ed25519.o
 cleanup.o
-crypto_kem_sntrup4591761.o
-crypto_kem_sntrup4591761x25519.o
+crypto_sort_uint32.o
+crypto_kem_sntrup761.o
+crypto_kem_sntrup761x25519.o
diff -pruN 20190101-1/crypto/crypto_onetimeauth_poly1305.c 20220801-1/crypto/crypto_onetimeauth_poly1305.c
--- 20190101-1/crypto/crypto_onetimeauth_poly1305.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_onetimeauth_poly1305.c	2022-07-17 07:30:14.000000000 +0000
@@ -1,5 +1,5 @@
 /*
-20180104
+20200202
 */
 /*
 Based on poly1305-donna (https://github.com/floodyberry/poly1305-opt/blob/master/extensions/poly1305_ref-32.c)
@@ -8,21 +8,22 @@ Based on poly1305-donna (https://github.
 
 #include "crypto_onetimeauth_poly1305.h"
 
-static unsigned long unpack(const unsigned char *x) {
+/* clang-format off */
+static inline unsigned long unpack32(const unsigned char *x) {
     return
         (unsigned long) (x[0])                  \
     | (((unsigned long) (x[1])) << 8)           \
     | (((unsigned long) (x[2])) << 16)          \
     | (((unsigned long) (x[3])) << 24);
 }
-static void pack(unsigned char *x, unsigned long u) {
+static inline void pack32(unsigned char *x, unsigned long u) {
     x[0] = u; u >>= 8;
     x[1] = u; u >>= 8;
     x[2] = u; u >>= 8;
     x[3] = u;
 }
 
-int crypto_onetimeauth_poly1305_tinynacl(unsigned char *o, const unsigned char *m, unsigned long long n, const unsigned char *k) {
+int crypto_onetimeauth_poly1305_tinyssh(unsigned char *o, const unsigned char *m, unsigned long long n, const unsigned char *k) {
 
     unsigned long h0, h1, h2, h3, h4;
     unsigned long r0, r1, r2, r3, r4;
@@ -34,11 +35,11 @@ int crypto_onetimeauth_poly1305_tinynacl
 
 
     /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
-    r0 = (unpack(k +  0)     ) & 0x3ffffff;
-    r1 = (unpack(k +  3) >> 2) & 0x3ffff03;
-    r2 = (unpack(k +  6) >> 4) & 0x3ffc0ff;
-    r3 = (unpack(k +  9) >> 6) & 0x3f03fff;
-    r4 = (unpack(k + 12) >> 8) & 0x00fffff;
+    r0 = (unpack32(k +  0)     ) & 0x3ffffff;
+    r1 = (unpack32(k +  3) >> 2) & 0x3ffff03;
+    r2 = (unpack32(k +  6) >> 4) & 0x3ffc0ff;
+    r3 = (unpack32(k +  9) >> 6) & 0x3f03fff;
+    r4 = (unpack32(k + 12) >> 8) & 0x00fffff;
 
     s1 = r1 * 5;
     s2 = r2 * 5;
@@ -48,26 +49,28 @@ int crypto_onetimeauth_poly1305_tinynacl
     /* h = 0 */
     h0 = h1 = h2 = h3 = h4 = 0;
 
-    while ((long long)n > 0) {
-
+    while (n > 0) {
         /* h += m[i] */
         if (n >= 16) {
-            h0 += (unpack(m     )     ) & 0x3ffffff;
-            h1 += (unpack(m +  3) >> 2) & 0x3ffffff;
-            h2 += (unpack(m +  6) >> 4) & 0x3ffffff;
-            h3 += (unpack(m +  9) >> 6) & 0x3ffffff;
-            h4 += (unpack(m + 12) >> 8) | 16777216;
+            h0 += (unpack32(m     )     ) & 0x3ffffff;
+            h1 += (unpack32(m +  3) >> 2) & 0x3ffffff;
+            h2 += (unpack32(m +  6) >> 4) & 0x3ffffff;
+            h3 += (unpack32(m +  9) >> 6) & 0x3ffffff;
+            h4 += (unpack32(m + 12) >> 8) | 16777216;
+            m += 16;
+            n -= 16;
         }
         else {
             unsigned char mm[16];
             for (i = 0; i < 16; ++i) mm[i] = 0;
             for (i = 0; i <  n; ++i) mm[i] = m[i];
             mm[i] = 1;
-            h0 += (unpack(mm     )     ) & 0x3ffffff;
-            h1 += (unpack(mm +  3) >> 2) & 0x3ffffff;
-            h2 += (unpack(mm +  6) >> 4) & 0x3ffffff;
-            h3 += (unpack(mm +  9) >> 6) & 0x3ffffff;
-            h4 += (unpack(mm + 12) >> 8);
+            h0 += (unpack32(mm     )     ) & 0x3ffffff;
+            h1 += (unpack32(mm +  3) >> 2) & 0x3ffffff;
+            h2 += (unpack32(mm +  6) >> 4) & 0x3ffffff;
+            h3 += (unpack32(mm +  9) >> 6) & 0x3ffffff;
+            h4 += (unpack32(mm + 12) >> 8);
+            n = 0;
         }
 
         /* h *= r */
@@ -85,9 +88,6 @@ int crypto_onetimeauth_poly1305_tinynacl
         d4 += c;      c = (unsigned long)(d4 >> 26); h4 = (unsigned long)d4 & 0x3ffffff;
         h0 += c * 5;  c =                (h0 >> 26); h0 =                h0 & 0x3ffffff;
         h1 += c;
-
-        m += 16;
-        n -= 16;
     }
 
 
@@ -127,20 +127,20 @@ int crypto_onetimeauth_poly1305_tinynacl
     h3 = ((h3 >> 18) | (h4 <<  8)) & 0xffffffff;
 
     /* mac = (h + pad) % (2^128) */
-    f = (unsigned long long)h0 + unpack(k + 16)            ; h0 = (unsigned long)f;
-    f = (unsigned long long)h1 + unpack(k + 20) + (f >> 32); h1 = (unsigned long)f;
-    f = (unsigned long long)h2 + unpack(k + 24) + (f >> 32); h2 = (unsigned long)f;
-    f = (unsigned long long)h3 + unpack(k + 28) + (f >> 32); h3 = (unsigned long)f;
-
-    pack(o +  0, h0);
-    pack(o +  4, h1);
-    pack(o +  8, h2);
-    pack(o + 12, h3);
+    f = (unsigned long long)h0 + unpack32(k + 16)            ; h0 = (unsigned long)f;
+    f = (unsigned long long)h1 + unpack32(k + 20) + (f >> 32); h1 = (unsigned long)f;
+    f = (unsigned long long)h2 + unpack32(k + 24) + (f >> 32); h2 = (unsigned long)f;
+    f = (unsigned long long)h3 + unpack32(k + 28) + (f >> 32); h3 = (unsigned long)f;
+
+    pack32(o +  0, h0);
+    pack32(o +  4, h1);
+    pack32(o +  8, h2);
+    pack32(o + 12, h3);
 
     return 0;
 }
 
-int crypto_onetimeauth_poly1305_tinynacl_verify(const unsigned char *h, const unsigned char *in, unsigned long long l, const unsigned char *k) {
+int crypto_onetimeauth_poly1305_tinyssh_verify(const unsigned char *h, const unsigned char *in, unsigned long long l, const unsigned char *k) {
 
     unsigned char correct[16];
     unsigned int d = 0;
@@ -151,3 +151,4 @@ int crypto_onetimeauth_poly1305_tinynacl
     for (i = 0; i < 16; ++i) d |= correct[i] ^ h[i];
     return (1 & ((d - 1) >> 8)) - 1;
 }
+/* clang-format on */
diff -pruN 20190101-1/crypto/crypto_onetimeauth_poly1305.h 20220801-1/crypto/crypto_onetimeauth_poly1305.h
--- 20190101-1/crypto/crypto_onetimeauth_poly1305.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_onetimeauth_poly1305.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,16 +1,16 @@
 #ifndef crypto_onetimeauth_poly1305_H
 #define crypto_onetimeauth_poly1305_H
 
-#define crypto_onetimeauth_poly1305_tinynacl_BYTES 16
-#define crypto_onetimeauth_poly1305_tinynacl_KEYBYTES 32
-extern int crypto_onetimeauth_poly1305_tinynacl(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);
-extern int crypto_onetimeauth_poly1305_tinynacl_verify(const unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);
+#define crypto_onetimeauth_poly1305_tinyssh_BYTES 16
+#define crypto_onetimeauth_poly1305_tinyssh_KEYBYTES 32
+extern int crypto_onetimeauth_poly1305_tinyssh(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);
+extern int crypto_onetimeauth_poly1305_tinyssh_verify(const unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);
 
-#define crypto_onetimeauth_poly1305 crypto_onetimeauth_poly1305_tinynacl
-#define crypto_onetimeauth_poly1305_verify crypto_onetimeauth_poly1305_tinynacl_verify
-#define crypto_onetimeauth_poly1305_BYTES crypto_onetimeauth_poly1305_tinynacl_BYTES
-#define crypto_onetimeauth_poly1305_KEYBYTES crypto_onetimeauth_poly1305_tinynacl_KEYBYTES
-#define crypto_onetimeauth_poly1305_IMPLEMENTATION "tinynacl"
+#define crypto_onetimeauth_poly1305 crypto_onetimeauth_poly1305_tinyssh
+#define crypto_onetimeauth_poly1305_verify crypto_onetimeauth_poly1305_tinyssh_verify
+#define crypto_onetimeauth_poly1305_BYTES crypto_onetimeauth_poly1305_tinyssh_BYTES
+#define crypto_onetimeauth_poly1305_KEYBYTES crypto_onetimeauth_poly1305_tinyssh_KEYBYTES
+#define crypto_onetimeauth_poly1305_IMPLEMENTATION "tinyssh"
 #define crypto_onetimeauth_poly1305_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/CRYPTOPRIMITIVES 20220801-1/crypto/CRYPTOPRIMITIVES
--- 20190101-1/crypto/CRYPTOPRIMITIVES	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/CRYPTOPRIMITIVES	2022-07-17 07:30:14.000000000 +0000
@@ -15,5 +15,6 @@ randombytes 0
 uint32_pack_big 0
 uint32_unpack_big 0
 cleanup 0
-crypto_kem_sntrup4591761 1
-crypto_kem_sntrup4591761x25519 1
+crypto_sort_uint32 1
+crypto_kem_sntrup761 1
+crypto_kem_sntrup761x25519 1
diff -pruN 20190101-1/crypto/crypto_scalarmult_curve25519.c 20220801-1/crypto/crypto_scalarmult_curve25519.c
--- 20190101-1/crypto/crypto_scalarmult_curve25519.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_scalarmult_curve25519.c	2022-07-17 07:30:14.000000000 +0000
@@ -2,7 +2,7 @@
 #include "fe25519.h"
 #include "crypto_scalarmult_curve25519.h"
 
-int crypto_scalarmult_curve25519_tinynacl(unsigned char *q, const unsigned char *n, const unsigned char *p) {
+int crypto_scalarmult_curve25519_tinyssh(unsigned char *q, const unsigned char *n, const unsigned char *p) {
 
     unsigned char e[32];
     fe x1, x2, z2, x3, z3, tmp0, tmp1;
@@ -68,6 +68,6 @@ int crypto_scalarmult_curve25519_tinynac
 
 static const unsigned char basepoint[32] = {9};
 
-int crypto_scalarmult_curve25519_tinynacl_base(unsigned char *q, const unsigned char *n) {
-    return crypto_scalarmult_curve25519_tinynacl(q, n, basepoint);
+int crypto_scalarmult_curve25519_tinyssh_base(unsigned char *q, const unsigned char *n) {
+    return crypto_scalarmult_curve25519_tinyssh(q, n, basepoint);
 }
diff -pruN 20190101-1/crypto/crypto_scalarmult_curve25519.h 20220801-1/crypto/crypto_scalarmult_curve25519.h
--- 20190101-1/crypto/crypto_scalarmult_curve25519.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_scalarmult_curve25519.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,16 +1,16 @@
 #ifndef crypto_scalarmult_curve25519_H
 #define crypto_scalarmult_curve25519_H
 
-#define crypto_scalarmult_curve25519_tinynacl_BYTES 32
-#define crypto_scalarmult_curve25519_tinynacl_SCALARBYTES 32
-extern int crypto_scalarmult_curve25519_tinynacl(unsigned char *,const unsigned char *,const unsigned char *);
-extern int crypto_scalarmult_curve25519_tinynacl_base(unsigned char *,const unsigned char *);
+#define crypto_scalarmult_curve25519_tinyssh_BYTES 32
+#define crypto_scalarmult_curve25519_tinyssh_SCALARBYTES 32
+extern int crypto_scalarmult_curve25519_tinyssh(unsigned char *,const unsigned char *,const unsigned char *);
+extern int crypto_scalarmult_curve25519_tinyssh_base(unsigned char *,const unsigned char *);
 
-#define crypto_scalarmult_curve25519 crypto_scalarmult_curve25519_tinynacl
-#define crypto_scalarmult_curve25519_base crypto_scalarmult_curve25519_tinynacl_base
-#define crypto_scalarmult_curve25519_BYTES crypto_scalarmult_curve25519_tinynacl_BYTES
-#define crypto_scalarmult_curve25519_SCALARBYTES crypto_scalarmult_curve25519_tinynacl_SCALARBYTES
-#define crypto_scalarmult_curve25519_IMPLEMENTATION "tinynacl"
+#define crypto_scalarmult_curve25519 crypto_scalarmult_curve25519_tinyssh
+#define crypto_scalarmult_curve25519_base crypto_scalarmult_curve25519_tinyssh_base
+#define crypto_scalarmult_curve25519_BYTES crypto_scalarmult_curve25519_tinyssh_BYTES
+#define crypto_scalarmult_curve25519_SCALARBYTES crypto_scalarmult_curve25519_tinyssh_SCALARBYTES
+#define crypto_scalarmult_curve25519_IMPLEMENTATION "tinyssh"
 #define crypto_scalarmult_curve25519_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/crypto_sign_ed25519.c 20220801-1/crypto/crypto_sign_ed25519.c
--- 20190101-1/crypto/crypto_sign_ed25519.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_sign_ed25519.c	2022-07-17 07:30:14.000000000 +0000
@@ -6,7 +6,7 @@
 #include "sc25519.h"
 #include "crypto_sign_ed25519.h"
 
-int crypto_sign_ed25519_tinynacl(unsigned char *sm, unsigned long long *smlen, const unsigned char *m, unsigned long long n, const unsigned char *skorig) {
+int crypto_sign_ed25519_tinyssh(unsigned char *sm, unsigned long long *smlen, const unsigned char *m, unsigned long long n, const unsigned char *skorig) {
 
     long long i;
     unsigned char nonce[64], hram[64], sk[64], pk[32];
@@ -47,7 +47,7 @@ int crypto_sign_ed25519_tinynacl(unsigne
     return 0;
 }
 
-int crypto_sign_ed25519_tinynacl_open(unsigned char *m, unsigned long long *mlen, const unsigned char *sm, unsigned long long n, const unsigned char *pk) {
+int crypto_sign_ed25519_tinyssh_open(unsigned char *m, unsigned long long *mlen, const unsigned char *sm, unsigned long long n, const unsigned char *pk) {
 
     long long i;
     unsigned char pkcopy[32], rcopy[32], scopy[32], hram[64], rcheck[32];
@@ -100,7 +100,7 @@ cleanup:
     return ret;
 }
 
-int crypto_sign_ed25519_tinynacl_keypair(unsigned char *pk, unsigned char *sk) {
+int crypto_sign_ed25519_tinyssh_keypair(unsigned char *pk, unsigned char *sk) {
 
     unsigned char h[64];
     ge25519 A;
diff -pruN 20190101-1/crypto/crypto_sign_ed25519.h 20220801-1/crypto/crypto_sign_ed25519.h
--- 20190101-1/crypto/crypto_sign_ed25519.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_sign_ed25519.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,20 +1,20 @@
 #ifndef crypto_sign_ed25519_H
 #define crypto_sign_ed25519_H
 
-#define crypto_sign_ed25519_tinynacl_SECRETKEYBYTES 64
-#define crypto_sign_ed25519_tinynacl_PUBLICKEYBYTES 32
-#define crypto_sign_ed25519_tinynacl_BYTES 64
-extern int crypto_sign_ed25519_tinynacl(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *);
-extern int crypto_sign_ed25519_tinynacl_open(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *);
-extern int crypto_sign_ed25519_tinynacl_keypair(unsigned char *,unsigned char *);
+#define crypto_sign_ed25519_tinyssh_SECRETKEYBYTES 64
+#define crypto_sign_ed25519_tinyssh_PUBLICKEYBYTES 32
+#define crypto_sign_ed25519_tinyssh_BYTES 64
+extern int crypto_sign_ed25519_tinyssh(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *);
+extern int crypto_sign_ed25519_tinyssh_open(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *);
+extern int crypto_sign_ed25519_tinyssh_keypair(unsigned char *,unsigned char *);
 
-#define crypto_sign_ed25519 crypto_sign_ed25519_tinynacl
-#define crypto_sign_ed25519_open crypto_sign_ed25519_tinynacl_open
-#define crypto_sign_ed25519_keypair crypto_sign_ed25519_tinynacl_keypair
-#define crypto_sign_ed25519_BYTES crypto_sign_ed25519_tinynacl_BYTES
-#define crypto_sign_ed25519_PUBLICKEYBYTES crypto_sign_ed25519_tinynacl_PUBLICKEYBYTES
-#define crypto_sign_ed25519_SECRETKEYBYTES crypto_sign_ed25519_tinynacl_SECRETKEYBYTES
-#define crypto_sign_ed25519_IMPLEMENTATION "tinynacl"
+#define crypto_sign_ed25519 crypto_sign_ed25519_tinyssh
+#define crypto_sign_ed25519_open crypto_sign_ed25519_tinyssh_open
+#define crypto_sign_ed25519_keypair crypto_sign_ed25519_tinyssh_keypair
+#define crypto_sign_ed25519_BYTES crypto_sign_ed25519_tinyssh_BYTES
+#define crypto_sign_ed25519_PUBLICKEYBYTES crypto_sign_ed25519_tinyssh_PUBLICKEYBYTES
+#define crypto_sign_ed25519_SECRETKEYBYTES crypto_sign_ed25519_tinyssh_SECRETKEYBYTES
+#define crypto_sign_ed25519_IMPLEMENTATION "tinyssh"
 #define crypto_sign_ed25519_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/crypto_sort_uint32.c 20220801-1/crypto/crypto_sort_uint32.c
--- 20190101-1/crypto/crypto_sort_uint32.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto/crypto_sort_uint32.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,38 @@
+#include "crypto_uint32.h"
+#include "crypto_sort_uint32.h"
+
+static void minmax(crypto_uint32 *x, crypto_uint32 *y) {
+
+    crypto_uint32 xi = *x;
+    crypto_uint32 yi = *y;
+    crypto_uint32 xy = xi ^ yi;
+    crypto_uint32 c = yi - xi;
+
+    c ^= xy & (c ^ yi ^ 0x80000000);
+    c >>= 31;
+    c &= 1;
+    c = -c;
+    c &= xy;
+    *x = xi ^ c;
+    *y = yi ^ c;
+}
+
+void crypto_sort_uint32_tinyssh(void *xv, long long n) {
+
+    long long top, p, q, i;
+    crypto_uint32 *x = xv;
+
+    if (n < 2) return;
+    top = 1;
+    while (top < n - top) top += top;
+
+    for (p = top; p > 0; p >>= 1) {
+        for (i = 0; i < n - p; ++i)
+            if (!(i & p))
+                minmax(x + i, x + i + p);
+        for (q = top; q > p; q >>= 1)
+            for (i = 0; i < n - q; ++i)
+                if (!(i & p))
+                    minmax(x + i + p, x + i + q);
+    }
+}
diff -pruN 20190101-1/crypto/crypto_sort_uint32.h 20220801-1/crypto/crypto_sort_uint32.h
--- 20190101-1/crypto/crypto_sort_uint32.h	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto/crypto_sort_uint32.h	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,10 @@
+#ifndef crypto_sort_uint32_H
+#define crypto_sort_uint32_H
+
+extern void crypto_sort_uint32_tinyssh(void *, long long);
+
+#define crypto_sort_uint32 crypto_sort_uint32_tinyssh
+#define crypto_sort_uint32_IMPLEMENTATION "tinyssh"
+#define crypto_sort_uint32_VERSION "-"
+
+#endif
diff -pruN 20190101-1/crypto/CRYPTOSOURCES 20220801-1/crypto/CRYPTOSOURCES
--- 20190101-1/crypto/CRYPTOSOURCES	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/CRYPTOSOURCES	2022-07-17 07:30:14.000000000 +0000
@@ -17,5 +17,6 @@ sc25519
 crypto_scalarmult_curve25519
 crypto_sign_ed25519
 cleanup
-crypto_kem_sntrup4591761
-crypto_kem_sntrup4591761x25519
+crypto_sort_uint32
+crypto_kem_sntrup761
+crypto_kem_sntrup761x25519
diff -pruN 20190101-1/crypto/crypto_stream_chacha20.c 20220801-1/crypto/crypto_stream_chacha20.c
--- 20190101-1/crypto/crypto_stream_chacha20.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_stream_chacha20.c	2022-07-17 07:30:14.000000000 +0000
@@ -1,32 +1,34 @@
 /*
-20180104
+20210508
 Jan Mojzis
 Public domain.
 */
 
+#include <stdint.h>
 #include "crypto_stream_chacha20.h"
 
-static unsigned long unpack32(const unsigned char *x) {
+/* clang-format off */
+static inline uint32_t unpack32(const unsigned char *x) {
     return
-        (unsigned long) (x[0])                  \
-    | (((unsigned long) (x[1])) << 8)           \
-    | (((unsigned long) (x[2])) << 16)          \
-    | (((unsigned long) (x[3])) << 24);
+        (uint32_t) (x[0])                  \
+    | (((uint32_t) (x[1])) << 8)           \
+    | (((uint32_t) (x[2])) << 16)          \
+    | (((uint32_t) (x[3])) << 24);
 }
-static void pack32(unsigned char *x, unsigned long u) {
+static inline void pack32(unsigned char *x, uint32_t u) {
     x[0] = u; u >>= 8;
     x[1] = u; u >>= 8;
     x[2] = u; u >>= 8;
     x[3] = u;
 }
 
-#define ROTATE32(x, c) ((x) << (c)) | (((x) & 0xffffffff) >> (32 - (c)))
+#define ROTATE(x, c) ((x) << (c)) ^ ((x) >> (32 - (c)))
 
 #define QUARTERROUND(a, b, c, d)                    \
-    a += b; d = ROTATE32(d ^ a, 16);                \
-    c += d; b = ROTATE32(b ^ c, 12);                \
-    a += b; d = ROTATE32(d ^ a,  8);                \
-    c += d; b = ROTATE32(b ^ c,  7);
+    a += b; d = ROTATE(d ^ a, 16);                  \
+    c += d; b = ROTATE(b ^ c, 12);                  \
+    a += b; d = ROTATE(d ^ a,  8);                  \
+    c += d; b = ROTATE(b ^ c,  7);
 
 #define TWOROUNDS                                   \
     QUARTERROUND( x0, x4,  x8, x12)                 \
@@ -84,73 +86,60 @@ static void pack32(unsigned char *x, uns
     pack32(o + 56, (x14 + n2) ^ unpack32(i + 56));  \
     pack32(o + 60, (x15 + n3) ^ unpack32(i + 60));
 
-#define _CRYPTO_STREAM_XOR(inttype, fcename)        \
-static int fcename( unsigned char *c,               \
-                    const unsigned char *m,         \
-                    unsigned long long l,           \
-                    const unsigned char *n,         \
-                    const unsigned char *k) {       \
-                                                    \
-    inttype x0, x1, x2, x3, x4, x5, x6, x7;         \
-    inttype x8, x9, x10, x11, x12, x13, x14, x15;   \
-    inttype k0 = unpack32(k     );                  \
-    inttype k1 = unpack32(k +  4);                  \
-    inttype k2 = unpack32(k +  8);                  \
-    inttype k3 = unpack32(k + 12);                  \
-    inttype k4 = unpack32(k + 16);                  \
-    inttype k5 = unpack32(k + 20);                  \
-    inttype k6 = unpack32(k + 24);                  \
-    inttype k7 = unpack32(k + 28);                  \
-    inttype n0 = 0;                                 \
-    inttype n1 = 0;                                 \
-    inttype n2 = unpack32(n    );                   \
-    inttype n3 = unpack32(n + 4);                   \
-    inttype s0 = 0x61707865;                        \
-    inttype s1 = 0x3320646E;                        \
-    inttype s2 = 0x79622D32;                        \
-    inttype s3 = 0x6B206574;                        \
-    unsigned long long u = 0;                       \
-                                                    \
-    if (!l) return 0;                               \
-                                                    \
-    while (l >= 64) {                               \
-        XORBLOCK(c, m);                             \
-                                                    \
-        ++u;                                        \
-        if (!u) return -1;                          \
-        n0 = (inttype)(u & 0xffffffff);             \
-        n1 = (inttype)(u >> 32);                    \
-                                                    \
-        l -= 64;                                    \
-        c += 64;                                    \
-        m += 64;                                    \
-    }                                               \
-    if (l) {                                        \
-        unsigned char b[64] = {0};                  \
-        long long j;                                \
-                                                    \
-        for (j = 0; j < l; ++j) b[j] = m[j];        \
-        XORBLOCK(b, b);                             \
-        for (j = 0; j < l; ++j) c[j] = b[j];        \
-    }                                               \
-    return 0;                                       \
-}
-
-_CRYPTO_STREAM_XOR(unsigned int, int_crypto_stream_xor)
-_CRYPTO_STREAM_XOR(unsigned long, long_crypto_stream_xor)
+int crypto_stream_chacha20_tinyssh_xor(unsigned char *c, const unsigned char *m, unsigned long long l, const unsigned char *n, const unsigned char *k) {
 
-int crypto_stream_chacha20_tinynacl_xor(unsigned char *c, const unsigned char *m, unsigned long long l, const unsigned char *n, const unsigned char *k) {
-    if (sizeof(int) == 4) return int_crypto_stream_xor(c, m, l, n, k);
-    return long_crypto_stream_xor(c, m, l, n, k);
+    register uint32_t x0, x1, x2, x3, x4, x5, x6, x7;
+    register uint32_t x8, x9, x10, x11, x12, x13, x14, x15;
+    uint32_t k0 = unpack32(k     );
+    uint32_t k1 = unpack32(k +  4);
+    uint32_t k2 = unpack32(k +  8);
+    uint32_t k3 = unpack32(k + 12);
+    uint32_t k4 = unpack32(k + 16);
+    uint32_t k5 = unpack32(k + 20);
+    uint32_t k6 = unpack32(k + 24);
+    uint32_t k7 = unpack32(k + 28);
+    uint32_t n0 = 0;
+    uint32_t n1 = 0;
+    uint32_t n2 = unpack32(n    );
+    uint32_t n3 = unpack32(n + 4);
+    uint32_t s0 = 0x61707865;
+    uint32_t s1 = 0x3320646E;
+    uint32_t s2 = 0x79622D32;
+    uint32_t s3 = 0x6B206574;
+    uint64_t u = 0;
+
+    if (!l) return 0;
+
+    while (l >= 64) {
+        XORBLOCK(c, m);
+
+        if (!++u) return -1;
+        n0 = u;
+        n1 = u >> 32;
+
+        l -= 64;
+        c += 64;
+        m += 64;
+    }
+    if (l) {
+        unsigned char b[64] = {0};
+        unsigned long long j;
+
+        for (j = 0; j < l; ++j) b[j] = m[j];
+        XORBLOCK(b, b);
+        for (j = 0; j < l; ++j) c[j] = b[j];
+    }
+    return 0;
 }
 
-int crypto_stream_chacha20_tinynacl(unsigned char *c, unsigned long long l, const unsigned char *n, const unsigned char *k) {
+int crypto_stream_chacha20_tinyssh(unsigned char *c, unsigned long long l, const unsigned char *n, const unsigned char *k) {
 
-    long long j;
+    unsigned long long j;
     unsigned char ncopy[8], kcopy[32];
 
     for (j = 0; j < 32; ++j) kcopy[j] = k[j];
     for (j = 0; j <  8; ++j) ncopy[j] = n[j];
     for (j = 0; j <  l; ++j) c[j] = 0;
-    return crypto_stream_chacha20_tinynacl_xor(c, c, l, ncopy, kcopy);
+    return crypto_stream_chacha20_tinyssh_xor(c, c, l, ncopy, kcopy);
 }
+/* clang-format on */
diff -pruN 20190101-1/crypto/crypto_stream_chacha20.h 20220801-1/crypto/crypto_stream_chacha20.h
--- 20190101-1/crypto/crypto_stream_chacha20.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_stream_chacha20.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,16 +1,16 @@
 #ifndef crypto_stream_chacha20_H
 #define crypto_stream_chacha20_H
 
-#define crypto_stream_chacha20_tinynacl_KEYBYTES 32
-#define crypto_stream_chacha20_tinynacl_NONCEBYTES 8
-extern int crypto_stream_chacha20_tinynacl(unsigned char *, unsigned long long, const unsigned char *, const unsigned char *);
-extern int crypto_stream_chacha20_tinynacl_xor(unsigned char *, const unsigned char *, unsigned long long, const unsigned char *, const unsigned char *);
+#define crypto_stream_chacha20_tinyssh_KEYBYTES 32
+#define crypto_stream_chacha20_tinyssh_NONCEBYTES 8
+extern int crypto_stream_chacha20_tinyssh(unsigned char *, unsigned long long, const unsigned char *, const unsigned char *);
+extern int crypto_stream_chacha20_tinyssh_xor(unsigned char *, const unsigned char *, unsigned long long, const unsigned char *, const unsigned char *);
 
-#define crypto_stream_chacha20 crypto_stream_chacha20_tinynacl
-#define crypto_stream_chacha20_xor crypto_stream_chacha20_tinynacl_xor
-#define crypto_stream_chacha20_KEYBYTES crypto_stream_chacha20_tinynacl_KEYBYTES
-#define crypto_stream_chacha20_NONCEBYTES crypto_stream_chacha20_tinynacl_NONCEBYTES
-#define crypto_stream_chacha20_IMPLEMENTATION "tinynacl"
+#define crypto_stream_chacha20 crypto_stream_chacha20_tinyssh
+#define crypto_stream_chacha20_xor crypto_stream_chacha20_tinyssh_xor
+#define crypto_stream_chacha20_KEYBYTES crypto_stream_chacha20_tinyssh_KEYBYTES
+#define crypto_stream_chacha20_NONCEBYTES crypto_stream_chacha20_tinyssh_NONCEBYTES
+#define crypto_stream_chacha20_IMPLEMENTATION "tinyssh"
 #define crypto_stream_chacha20_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/crypto_verify_16.c 20220801-1/crypto/crypto_verify_16.c
--- 20190101-1/crypto/crypto_verify_16.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_verify_16.c	2022-07-17 07:30:14.000000000 +0000
@@ -1,6 +1,6 @@
 #include "verify.h"
 #include "crypto_verify_16.h"
 
-int crypto_verify_16_tinynacl(const unsigned char *x, const unsigned char *y) {
+int crypto_verify_16_tinyssh(const unsigned char *x, const unsigned char *y) {
     return verify(x, y, 16);
 }
diff -pruN 20190101-1/crypto/crypto_verify_16.h 20220801-1/crypto/crypto_verify_16.h
--- 20190101-1/crypto/crypto_verify_16.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_verify_16.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,12 +1,12 @@
 #ifndef crypto_verify_16_H
 #define crypto_verify_16_H
 
-#define crypto_verify_16_tinynacl_BYTES 16
-extern int crypto_verify_16_tinynacl(const unsigned char *, const unsigned char *);
+#define crypto_verify_16_tinyssh_BYTES 16
+extern int crypto_verify_16_tinyssh(const unsigned char *, const unsigned char *);
 
-#define crypto_verify_16 crypto_verify_16_tinynacl
-#define crypto_verify_16_BYTES crypto_verify_16_tinynacl_BYTES
-#define crypto_verify_16_IMPLEMENTATION "tinynacl"
+#define crypto_verify_16 crypto_verify_16_tinyssh
+#define crypto_verify_16_BYTES crypto_verify_16_tinyssh_BYTES
+#define crypto_verify_16_IMPLEMENTATION "tinyssh"
 #define crypto_verify_16_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/crypto_verify_32.c 20220801-1/crypto/crypto_verify_32.c
--- 20190101-1/crypto/crypto_verify_32.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_verify_32.c	2022-07-17 07:30:14.000000000 +0000
@@ -1,6 +1,6 @@
 #include "verify.h"
 #include "crypto_verify_32.h"
 
-int crypto_verify_32_tinynacl(const unsigned char *x, const unsigned char *y) {
+int crypto_verify_32_tinyssh(const unsigned char *x, const unsigned char *y) {
     return verify(x, y, 32);
 }
diff -pruN 20190101-1/crypto/crypto_verify_32.h 20220801-1/crypto/crypto_verify_32.h
--- 20190101-1/crypto/crypto_verify_32.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/crypto_verify_32.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,12 +1,12 @@
 #ifndef crypto_verify_32_H
 #define crypto_verify_32_H
 
-#define crypto_verify_32_tinynacl_BYTES 32
-extern int crypto_verify_32_tinynacl(const unsigned char *, const unsigned char *);
+#define crypto_verify_32_tinyssh_BYTES 32
+extern int crypto_verify_32_tinyssh(const unsigned char *, const unsigned char *);
 
-#define crypto_verify_32 crypto_verify_32_tinynacl
-#define crypto_verify_32_BYTES crypto_verify_32_tinynacl_BYTES
-#define crypto_verify_32_IMPLEMENTATION "tinynacl"
+#define crypto_verify_32 crypto_verify_32_tinyssh
+#define crypto_verify_32_BYTES crypto_verify_32_tinyssh_BYTES
+#define crypto_verify_32_IMPLEMENTATION "tinyssh"
 #define crypto_verify_32_VERSION "-"
 
 #endif
diff -pruN 20190101-1/crypto/randombytes.h 20220801-1/crypto/randombytes.h
--- 20190101-1/crypto/randombytes.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto/randombytes.h	2022-07-17 07:30:14.000000000 +0000
@@ -4,7 +4,7 @@
 extern void randombytes(unsigned char *, unsigned long long);
 
 #ifndef randombytes_implementation
-#define randombytes_implementation "tinynacl"
+#define randombytes_implementation "tinyssh"
 #endif
 
 #endif
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup4591761test.c 20220801-1/crypto-tests/crypto_kem_sntrup4591761test.c
--- 20190101-1/crypto-tests/crypto_kem_sntrup4591761test.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup4591761test.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,77 +0,0 @@
-/*
-20181229
-Jan Mojzis
-Public domain.
-*/
-
-#include "misc.h"
-#include "crypto_kem_sntrup4591761.h"
-#include "crypto_kem_sntrup4591761test.data"
-
-unsigned char sk[crypto_kem_sntrup4591761_SECRETKEYBYTES + 16];
-unsigned char pk[crypto_kem_sntrup4591761_PUBLICKEYBYTES + 16];
-unsigned char c[crypto_kem_sntrup4591761_CIPHERTEXTBYTES + 16];
-unsigned char k1[crypto_kem_sntrup4591761_BYTES + 16];
-unsigned char k2[crypto_kem_sntrup4591761_BYTES + 16];
-#define xk2 k2
-
-static void test_random(void) {
-
-    long long i, j;
-
-    for (i = 0; i < 16; ++i) {
-        if (crypto_kem_sntrup4591761_keypair(pk + i, sk + i) != 0) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761_SECRETKEYBYTES);
-            fail("crypto_kem_sntrup4591761_keypair() failure, please report it !!!!!!!!!");
-        }
-        if (crypto_kem_sntrup4591761_enc(c + i, k1 + i, pk + i) != 0) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761_SECRETKEYBYTES);
-            fail_printdata("c", c + i, crypto_kem_sntrup4591761_CIPHERTEXTBYTES);
-            fail_printdata("k1", k1 + i, crypto_kem_sntrup4591761_BYTES);
-            fail("crypto_kem_sntrup4591761_enc() failure, please report it !!!!!!!!!");
-        }
-        if (crypto_kem_sntrup4591761_dec(k2 + i, c + i, sk + i) != 0) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761_SECRETKEYBYTES);
-            fail_printdata("c", c + i, crypto_kem_sntrup4591761_CIPHERTEXTBYTES);
-            fail_printdata("k1", k1 + i, crypto_kem_sntrup4591761_BYTES);
-            fail_printdata("k2", k2 + i, crypto_kem_sntrup4591761_BYTES);
-            fail("crypto_kem_sntrup4591761_dec() failure, please report it !!!!!!!!!");
-        }
-        for (j = 0; j < crypto_kem_sntrup4591761_BYTES; ++j) if (k1[i + j] != k2[i + j]) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761_SECRETKEYBYTES);
-            fail_printdata("c", c + i, crypto_kem_sntrup4591761_CIPHERTEXTBYTES);
-            fail_printdata("k1", k1 + i, crypto_kem_sntrup4591761_BYTES);
-            fail_printdata("k2", k2 + i, crypto_kem_sntrup4591761_BYTES);
-            fail("crypto_kem_sntrup4591761_dec() failure, please report it !!!!!!!!!");
-        }
-    }
-}
-
-static void test_dec(void) {
-
-    long long j;
-
-    if (crypto_kem_sntrup4591761_dec(xk2, xc, xsk) != 0) {
-        fail_printdata("xk1", xk1, crypto_kem_sntrup4591761_BYTES);
-        fail_printdata("xk2", xk2, crypto_kem_sntrup4591761_BYTES);
-        fail("crypto_kem_sntrup4591761_dec() failure, please report it !!!!!!!!!");
-    }
-    for (j = 0; j < crypto_kem_sntrup4591761_BYTES; ++j) if (xk1[j] != xk2[j]) {
-        fail_printdata("xk1", xk1, crypto_kem_sntrup4591761_BYTES);
-        fail_printdata("xk2", xk2, crypto_kem_sntrup4591761_BYTES);
-        fail("crypto_kem_sntrup4591761_dec() failure, please report it !!!!!!!!!");
-    }
-}
-
-
-int main(void) {
-
-    test_dec();
-    test_random();
-
-    _exit(0);
-}
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup4591761test.data 20220801-1/crypto-tests/crypto_kem_sntrup4591761test.data
--- 20190101-1/crypto-tests/crypto_kem_sntrup4591761test.data	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup4591761test.data	1970-01-01 00:00:00.000000000 +0000
@@ -1,341 +0,0 @@
-static unsigned char xsk[] = {
-    0x56, 0x55, 0x55, 0x99, 0x95, 0x95, 0x15, 0x84, 
-    0x55, 0x65, 0x51, 0x90, 0x16, 0x55, 0x95, 0x14, 
-    0x85, 0x56, 0x55, 0x15, 0x90, 0x54, 0x89, 0x55, 
-    0x65, 0x24, 0x54, 0x59, 0x15, 0x51, 0x91, 0x66, 
-    0x11, 0x95, 0xa1, 0x49, 0x96, 0x54, 0x55, 0x55, 
-    0x95, 0x16, 0x59, 0x55, 0x45, 0x59, 0x45, 0x25, 
-    0x12, 0x5a, 0x65, 0x41, 0x69, 0x55, 0x55, 0x55, 
-    0x65, 0x14, 0x16, 0x51, 0x49, 0x59, 0x44, 0x45, 
-    0x85, 0x95, 0x54, 0x51, 0x16, 0x95, 0x55, 0x54, 
-    0x59, 0x6a, 0x15, 0x45, 0x95, 0x56, 0x15, 0x61, 
-    0x9a, 0x59, 0x5a, 0x51, 0x15, 0x52, 0x54, 0x54, 
-    0x25, 0xa0, 0x64, 0x55, 0x51, 0x55, 0x95, 0xa5, 
-    0x24, 0x54, 0x50, 0x15, 0xa6, 0x99, 0x69, 0x68, 
-    0x29, 0x91, 0x56, 0x05, 0x0a, 0x55, 0x82, 0x0a, 
-    0x49, 0x21, 0x61, 0x52, 0x55, 0x92, 0x55, 0x61, 
-    0x85, 0x25, 0x66, 0x51, 0xa5, 0x51, 0x50, 0x59, 
-    0x54, 0x56, 0x59, 0x50, 0x59, 0x15, 0x15, 0x51, 
-    0x56, 0x44, 0x85, 0x54, 0x05, 0x65, 0x65, 0x98, 
-    0x55, 0x55, 0x59, 0x15, 0x59, 0x64, 0x59, 0x15, 
-    0xa6, 0x15, 0x49, 0x26, 0x15, 0x14, 0x55, 0x15, 
-    0x55, 0xa5, 0x01, 0xa1, 0x55, 0x24, 0x89, 0x55, 
-    0x91, 0x55, 0x44, 0x69, 0x25, 0x55, 0x52, 0x54, 
-    0x58, 0x15, 0x45, 0x52, 0x06, 0x09, 0x54, 0x5a, 
-    0x51, 0x91, 0x11, 0x01, 0x58, 0x59, 0x00, 0xaa, 
-    0xa0, 0x66, 0x29, 0x82, 0xaa, 0x56, 0xa4, 0x09, 
-    0x80, 0x6a, 0x60, 0x29, 0x4a, 0x66, 0x05, 0x44, 
-    0x62, 0x91, 0x54, 0x41, 0x10, 0xa5, 0x24, 0x4a, 
-    0x04, 0x05, 0x66, 0x44, 0xa9, 0x06, 0x0a, 0x64, 
-    0x69, 0xa2, 0x91, 0x89, 0x20, 0xa0, 0x00, 0x24, 
-    0xa0, 0x54, 0x18, 0x52, 0x6a, 0x44, 0xa9, 0x48, 
-    0x40, 0x94, 0x66, 0x85, 0xa9, 0x19, 0x60, 0x1a, 
-    0x09, 0x56, 0x12, 0x49, 0x18, 0x69, 0xa8, 0x92, 
-    0x56, 0x82, 0x5a, 0x94, 0xa9, 0x99, 0x25, 0x5a, 
-    0x46, 0x26, 0x61, 0x66, 0x4a, 0x5a, 0x61, 0x62, 
-    0x86, 0x22, 0x91, 0x18, 0xa1, 0x88, 0x4a, 0x14, 
-    0x85, 0x11, 0x19, 0x05, 0xa1, 0x20, 0xa8, 0x28, 
-    0x62, 0x64, 0x25, 0x65, 0x9a, 0x60, 0x88, 0x61, 
-    0x94, 0x68, 0x25, 0xa4, 0x14, 0x89, 0x5a, 0x11, 
-    0x08, 0x22, 0x59, 0x56, 0x04, 0x51, 0x95, 0x40, 
-    0x20, 0x96, 0x21, 0x90, 0x42, 0xa2, 0x50, 0x41, 
-    0x6a, 0x68, 0x64, 0x90, 0x5a, 0x59, 0x48, 0x65, 
-    0xa0, 0x18, 0xaa, 0x10, 0x12, 0x56, 0x99, 0xa9, 
-    0x40, 0x42, 0xa6, 0x85, 0x02, 0x88, 0x69, 0x28, 
-    0x04, 0x69, 0x9a, 0x1a, 0x45, 0x28, 0x48, 0x55, 
-    0x02, 0x88, 0x85, 0xa6, 0x94, 0x10, 0x8a, 0x24, 
-    0x54, 0x60, 0x04, 0x85, 0x8a, 0x82, 0x86, 0x20, 
-    0x05, 0xa4, 0x92, 0x11, 0x26, 0x68, 0xa1, 0x65, 
-    0x9a, 0x02, 0xa5, 0x25, 0x65, 0x00, 0xde, 0x69, 
-    0x12, 0x68, 0xfb, 0xc4, 0x57, 0x1e, 0x5f, 0xe8, 
-    0xd3, 0xb6, 0x94, 0x77, 0xbb, 0x29, 0xf5, 0x91, 
-    0x63, 0x3d, 0xaf, 0x90, 0x9b, 0x25, 0x56, 0xe8, 
-    0xa1, 0xad, 0xe9, 0x43, 0xd6, 0x04, 0x68, 0x40, 
-    0xba, 0x6f, 0xbe, 0x03, 0xcb, 0x14, 0x6f, 0xb9, 
-    0xad, 0xed, 0x13, 0x8c, 0xfd, 0x35, 0xe0, 0xc8, 
-    0x23, 0x69, 0xeb, 0xa1, 0x32, 0x28, 0xbf, 0xea, 
-    0x27, 0x36, 0xae, 0x58, 0x9b, 0x14, 0x16, 0x81, 
-    0x67, 0xa3, 0x16, 0xa2, 0xf4, 0x58, 0x82, 0xc5, 
-    0xd5, 0x13, 0xd0, 0xb6, 0x68, 0x06, 0xa6, 0x2b, 
-    0x1f, 0x6e, 0x68, 0x03, 0x91, 0x26, 0xca, 0x1d, 
-    0x95, 0x71, 0xd9, 0xc9, 0x1e, 0x07, 0x42, 0xb6, 
-    0x9d, 0x64, 0x21, 0xab, 0xb6, 0x32, 0x2d, 0xcc, 
-    0xac, 0xb3, 0xf1, 0x9f, 0x77, 0x3c, 0xa8, 0x19, 
-    0xc6, 0x69, 0x1e, 0x21, 0x1f, 0x2e, 0x2f, 0x0d, 
-    0x9d, 0xb9, 0x28, 0x9e, 0x8f, 0x0e, 0x92, 0x6f, 
-    0x61, 0xc3, 0x28, 0x36, 0xba, 0x52, 0x87, 0x09, 
-    0x71, 0x60, 0x7b, 0x0b, 0xb6, 0x01, 0x3f, 0xef, 
-    0x32, 0xf8, 0x35, 0xb3, 0x31, 0x31, 0xfa, 0xb0, 
-    0x40, 0xc6, 0xd2, 0x1a, 0x7b, 0x30, 0xd3, 0x4e, 
-    0xe3, 0xc9, 0x1a, 0x5f, 0x38, 0x52, 0x0a, 0x6b, 
-    0x77, 0x5c, 0xf8, 0x27, 0x8e, 0x09, 0x7e, 0xae, 
-    0x55, 0xda, 0xab, 0x69, 0x72, 0x54, 0xbb, 0x92, 
-    0x2c, 0x01, 0xc4, 0x13, 0x07, 0x05, 0x7f, 0x05, 
-    0x98, 0xa8, 0xb3, 0xba, 0x2a, 0x3a, 0xb2, 0x80, 
-    0xcc, 0x7e, 0xe6, 0xc7, 0xcf, 0x2e, 0xbb, 0xe1, 
-    0xfe, 0x9a, 0x1a, 0xf4, 0xdf, 0x2e, 0xbc, 0xc0, 
-    0x9b, 0x78, 0x74, 0xd3, 0xd5, 0x45, 0xf4, 0xfb, 
-    0x1e, 0x54, 0x10, 0xe5, 0x70, 0x10, 0x50, 0x85, 
-    0xc6, 0x9b, 0xc6, 0x5a, 0xeb, 0x27, 0xd9, 0xbc, 
-    0x87, 0xef, 0x22, 0x27, 0x76, 0x03, 0x0a, 0x63, 
-    0xe5, 0xbb, 0xbb, 0x3d, 0xdc, 0x4c, 0x61, 0xcc, 
-    0xd2, 0x58, 0xb7, 0x01, 0x0d, 0x2d, 0xaa, 0xc8, 
-    0x86, 0x64, 0xdc, 0xbc, 0x52, 0x17, 0x05, 0x5a, 
-    0x8b, 0xb4, 0x3b, 0x83, 0xaa, 0x46, 0xb4, 0xbd, 
-    0x28, 0x32, 0x8b, 0xa9, 0x35, 0x0c, 0xb7, 0x82, 
-    0xf5, 0x0d, 0x68, 0x38, 0xe1, 0x03, 0xcf, 0x8c, 
-    0xaa, 0x95, 0x17, 0xb8, 0x9f, 0x1c, 0x09, 0xff, 
-    0x7d, 0x3a, 0xfc, 0xf6, 0x82, 0x24, 0xbc, 0xe9, 
-    0x5f, 0x3e, 0x1e, 0xe8, 0x5b, 0x22, 0x79, 0x0a, 
-    0x51, 0x36, 0x8a, 0x53, 0x66, 0x1d, 0x4a, 0x43, 
-    0xfe, 0x15, 0xf8, 0x9a, 0x63, 0x4a, 0xe6, 0xf7, 
-    0x6d, 0xf5, 0x4a, 0x30, 0x05, 0x07, 0x9b, 0xf5, 
-    0x5b, 0x3a, 0x09, 0x6b, 0x3f, 0x52, 0xa6, 0x5c, 
-    0x7b, 0x14, 0x8e, 0x02, 0x48, 0x0e, 0x8c, 0xc8, 
-    0x71, 0x29, 0x35, 0x19, 0x87, 0x16, 0x26, 0xdc, 
-    0x9e, 0xb5, 0x10, 0x96, 0x45, 0x11, 0x16, 0x2e, 
-    0x23, 0x61, 0x3c, 0xf8, 0xed, 0x18, 0x30, 0xc5, 
-    0x8b, 0xd2, 0x84, 0xdc, 0xbe, 0x47, 0xa8, 0xb3, 
-    0x58, 0x53, 0x67, 0x13, 0x2e, 0x18, 0x84, 0x9a, 
-    0xcb, 0xbb, 0x9d, 0x36, 0x12, 0x06, 0xc4, 0x12, 
-    0xb1, 0xff, 0x95, 0x8e, 0x31, 0x34, 0x26, 0x18, 
-    0xc8, 0xfe, 0x76, 0xeb, 0x1f, 0x45, 0xa6, 0x2f, 
-    0xea, 0x3c, 0x12, 0xd9, 0x4a, 0x1d, 0x7f, 0x07, 
-    0x84, 0x22, 0x80, 0xa3, 0xaa, 0x38, 0x58, 0x6c, 
-    0xe9, 0xfa, 0x1e, 0x1e, 0xfc, 0x4b, 0xd9, 0xda, 
-    0xa9, 0x2c, 0xb5, 0xdc, 0xbd, 0x07, 0x53, 0xc8, 
-    0x40, 0x73, 0x59, 0xef, 0xe2, 0x08, 0x78, 0x4a, 
-    0x0f, 0x94, 0x06, 0xfd, 0x22, 0x02, 0xc1, 0xb7, 
-    0x01, 0x92, 0xdc, 0x0b, 0x8e, 0x5a, 0x03, 0x41, 
-    0xa1, 0xe8, 0xc0, 0x2e, 0xd4, 0x4b, 0xe8, 0x02, 
-    0x74, 0x84, 0xc2, 0x2a, 0x37, 0x40, 0x16, 0xf7, 
-    0x7e, 0xbd, 0xc7, 0x57, 0xd1, 0x45, 0x07, 0xd8, 
-    0x61, 0x8e, 0xc5, 0x1e, 0xb4, 0x01, 0x5f, 0x95, 
-    0xdd, 0xd8, 0x6f, 0xae, 0x61, 0x12, 0xae, 0x09, 
-    0xa6, 0x07, 0x20, 0x5b, 0x08, 0x0d, 0x77, 0x10, 
-    0xdd, 0x2f, 0x3e, 0xb7, 0x87, 0x41, 0x23, 0xfe, 
-    0x9d, 0xf4, 0xc4, 0xdb, 0x96, 0x48, 0x5b, 0xaf, 
-    0xf2, 0xa5, 0x5f, 0x5f, 0xf8, 0x36, 0xe4, 0xf5, 
-    0x06, 0xe7, 0xe4, 0x4a, 0x40, 0x48, 0xf7, 0x44, 
-    0x08, 0x68, 0x8c, 0xd7, 0x70, 0x56, 0x72, 0xff, 
-    0x2f, 0xf1, 0x77, 0x9b, 0x99, 0x0c, 0x37, 0x96, 
-    0x82, 0xd1, 0x75, 0x33, 0x63, 0x4b, 0xa7, 0x7a, 
-    0x01, 0x8a, 0x62, 0x48, 0x83, 0x0f, 0x22, 0xd9, 
-    0x23, 0xd7, 0xf4, 0xcc, 0x84, 0x30, 0xd1, 0xe3, 
-    0xc1, 0x7d, 0xc8, 0xcb, 0xce, 0x40, 0xa4, 0xdc, 
-    0xd9, 0x56, 0xc4, 0x7f, 0x05, 0x25, 0x68, 0x71, 
-    0xf8, 0x8f, 0x9e, 0xdc, 0x85, 0x2a, 0xd6, 0xef, 
-    0x85, 0x36, 0xd4, 0x58, 0x31, 0x3f, 0xa1, 0x0d, 
-    0x10, 0xa2, 0xdf, 0x9d, 0x87, 0x06, 0x2b, 0xc4, 
-    0x6c, 0x40, 0x41, 0x3b, 0xfb, 0x23, 0x35, 0xe5, 
-    0x84, 0x82, 0x30, 0xac, 0x3d, 0x5a, 0x00, 0x5e, 
-    0x97, 0x02, 0x04, 0x30, 0xc9, 0x13, 0xd6, 0xfe, 
-    0x6a, 0x4d, 0x11, 0x69, 0xb5, 0x57, 0xa9, 0x4c, 
-    0xa1, 0xd6, 0x55, 0x2b, 0x5c, 0x07, 0x09, 0x18, 
-    0xc1, 0xd9, 0xdb, 0x43, 0xba, 0x03, 0x39, 0xe3, 
-    0xaa, 0xbc, 0xd9, 0xea, 0xbb, 0x48, 0xad, 0x97, 
-    0xb3, 0xd0, 0xda, 0xb3, 0x30, 0x1f, 0xb0, 0x85, 
-    0x87, 0x46, 0xa9, 0xfa, 0xdf, 0x29, 0x13, 0xa0, 
-    0xf9, 0x84, 0x39, 0xe1, 0x3f, 0x48, 0xae, 0xe7, 
-    0x22, 0xf6, 0x00, 0x76, 0x85, 0x25, 0x08, 0x3b, 
-    0xe2, 0xd4, 0x7f, 0x61, 0x13, 0x40, 0x0d, 0x64, 
-    0x4b, 0x9e, 0x09, 0x3c, 0x20, 0x3a, 0x3b, 0xa8, 
-    0x85, 0x53, 0xf7, 0x45, 0x4e, 0x3d, 0x1e, 0xc6, 
-    0xd5, 0x45, 0xd1, 0x21, 0xd9, 0x09, 0xf5, 0x2a, 
-    0x41, 0xf7, 0x71, 0xf1, 0x0a, 0x43, 0x04, 0xb0, 
-    0xb4, 0x75, 0xee, 0xc0, 0x61, 0x10, 0x68, 0x89, 
-    0x1b, 0x95, 0x4e, 0x9e, 0xd9, 0x47, 0x44, 0x6f, 
-    0xa4, 0x77, 0xad, 0x21, 0xd7, 0x2e, 0xfd, 0xab, 
-    0xad, 0xaf, 0xcc, 0x31, 0x4c, 0x04, 0x66, 0x07, 
-    0xe0, 0xce, 0xb3, 0x51, 0x95, 0x2d, 0x17, 0x9e, 
-    0x45, 0x1d, 0x02, 0x22, 0x2f, 0x0e, 0x12, 0xf8, 
-    0x5a, 0x22, 0x87, 0x7a, 0xde, 0x1a, 0xac, 0x81, 
-    0xa4, 0xba, 0xa5, 0xc3, 0x67, 0x4b, 0x19, 0xfd, 
-    0xfa, 0xb5, 0x7b, 0x4e, 0xc9, 0x40, 0xbe, 0x36, 
-    0x27, 0x5d, 0xb4, 0xf8, 0x58, 0x00, 0x9b, 0xba, 
-    0x77, 0x64, 0x74, 0xf0, 0x1b, 0x48, 0xe1, 0xf9, 
-    0x6f, 0x93, 0x28, 0x89, 0x62, 0x2d, 0x4c, 0xc7, 
-    0x30, 0x79, 0xfa, 0x4f, 0xae, 0x29, 0x02, 0x3f, 
-    0xf4, 0xa6, 0xda, 0x04, 0x29, 0x45, 0xa5, 0x83, 
-    0x95, 0x9e, 0x1f, 0xe0, 0xe9, 0x43, 0x14, 0xc9, 
-    0x1a, 0x47, 0xef, 0x29, 0x12, 0x3d, 0xa9, 0x1d, 
-    0xa6, 0x4f, 0x93, 0x6f, 0xba, 0x39, 0x65, 0xc8, 
-    0x1f, 0x67, 0x87, 0xb4, 0xef, 0x07, 0xa1, 0xb2, 
-    0xc1, 0x6d, 0x2d, 0x72, 0xd9, 0x0f, 0x1d, 0x5a, 
-    0xcc, 0x25, 0x79, 0x5d, 0xe5, 0x10, 0x30, 0x01, 
-    0xf8, 0x53, 0x81, 0x11, 0xc4, 0x48, 0x2f, 0xe1, 
-    0x6c, 0xa3, 0x57, 0xf5, 0xb1, 0x50, 0x4b, 0xa3, 
-    0x59, 0x20, 0x47, 0x94, 0xb3, 0x13, 0xdc, 0x73, 
-    0xe3, 0x28, 0x46, 0x80, 0x98, 0x24, 0xd9, 0xae, 
-    0x9c, 0xca, 0xf0, 0x6b, 0x0d, 0x32, 0xc4, 0x9b, 
-    0xe8, 0x02, 0x43, 0xa6, 0x11, 0x03, 0xd9, 0x81, 
-    0x3f, 0xf3, 0x2a, 0x20, 0xa0, 0x01, 0x6e, 0x86, 
-    0x50, 0x8f, 0xb9, 0x80, 0xcd, 0x3c, 0x96, 0xd7, 
-    0x15, 0x4b, 0x37, 0xe9, 0xc2, 0x08, 0x08, 0xd1, 
-    0x27, 0xff, 0x1f, 0x75, 0xc3, 0x28, 0x35, 0x49, 
-    0xc7, 0x37, 0x67, 0x58, 0xe7, 0x03, 0x16, 0x1e, 
-    0xfb, 0x3c, 0x60, 0x1c, 0x56, 0x10, 0xb9, 0xcc, 
-    0x51, 0x5b, 0xcd, 0x2c, 0x6c, 0x11, 0x06, 0xb9, 
-    0x66, 0x44, 0xa1, 0x71, 0xeb, 0x3a, 0xe3, 0x25, 
-    0x24, 0xb9, 0x8a, 0xc7, 0xf4, 0x15, 0x19, 0x79, 
-    0xec, 0x75, 0xa0, 0xcc, 0xcd, 0x58, 0x1c, 0x03, 
-    0x3f, 0x2e, 0xe0, 0x2f, 0x64, 0x50, 0x11, 0x60, 
-    0x46, 0x79, 0xf9, 0x41, 0x1c, 0x16, 0x08, 0x3b, 
-    0xef, 0x25, 0xfc, 0xa2, 0xa1, 0x32, 0x0e, 0x22, 
-    0xd9, 0xaa, 0x1b, 0x07, 0x29, 0x2e, 0x8d, 0x5a, 
-    0x96, 0xbc, 0xf4, 0x12, 0x63, 0x49, 0xaa, 0xff, 
-    0x1f, 0x53, 0x96, 0x93, 0x40, 0x4d, 0x76, 0x69, 
-    0xd1, 0xc2, 0x0a, 0x45, 0xa6, 0x0a, 0xd5, 0xa8, 
-    0xa9, 0xf0, 0x32, 0x6a, 0x0d, 0x36, 0x91, 0x93, 
-    0xf1, 0x05, 0x96, 0xbc, 0x21, 0x52, 0x36, 0xb1, 
-    0x23, 0xbe, 0xb3, 0x85, 0xda, 0x3e, 0xe6, 0x7e, 
-    0x3b, 0x9f, 0x3e, 0xbc, 0x2a, 0x44, 0x73, 0x54, 
-    0x77, 0xe6, 0x84, 0xf6, 0x76, 0x3d, 0x66, 0x0f, 
-    0x6b, 0x03, 0x31, 0x78, 0x85, 0x47, 0x93, 0xf3, 
-    0x69, 0xc2, 0x75, 0xdf, 0xab, 0x26, 0xcc, 0xc3, 
-    0xd5, 0x74, 0x48, 0x6a, 0xb8, 0x28, 0xca, 0xe8, 
-    0x42, 0x03, 0x1b, 0x25, 0xfc, 0x2a, 0xa8, 0x01, 
-    0xa5, 0x07, 0xe8, 0x28, 0x65, 0x1f, 0x83, 0x32, 
-    0x87, 0xcc, 0x5f, 0x25, 0xd7, 0x00, 0xcc, 0xa0, 
-    0xf4, 0x2b, 0xd2, 0x4b, 0x12, 0x3d, 0x28, 0x41, 
-    0x8b, 0x7b, 0x9b, 0xaf, 0x2a, 0x45, 0xf5, 0x08
-};
-static unsigned char xc[] = {
-    0x47, 0x78, 0xe2, 0x2b, 0x99, 0x2d, 0x41, 0x22, 
-    0x30, 0xd0, 0x8e, 0xb1, 0x3c, 0xb9, 0x2a, 0xb8, 
-    0x9c, 0x2a, 0xb1, 0xa4, 0x07, 0xb3, 0x37, 0x70, 
-    0xc1, 0xc1, 0x68, 0xf0, 0x21, 0xc5, 0x55, 0x58, 
-    0x8b, 0x7b, 0x36, 0x82, 0x6d, 0x3f, 0x11, 0xcc, 
-    0xf3, 0x19, 0xb6, 0x7f, 0xbc, 0x36, 0x0f, 0x4d, 
-    0x5e, 0xe2, 0x73, 0x3c, 0xc3, 0x2d, 0x06, 0x28, 
-    0xf6, 0x2d, 0xe2, 0x5a, 0x0d, 0x40, 0x65, 0x24, 
-    0x41, 0x7e, 0x60, 0xa5, 0x6e, 0xd0, 0xc9, 0x33, 
-    0x80, 0xd4, 0x85, 0xb9, 0xff, 0x50, 0x0b, 0x90, 
-    0xa6, 0xea, 0xc5, 0x9f, 0xe9, 0x16, 0xa8, 0x49, 
-    0xae, 0x1b, 0x2d, 0xbe, 0x42, 0x20, 0xc1, 0x4b, 
-    0x7d, 0x9e, 0x71, 0x9b, 0x84, 0x97, 0x39, 0x0b, 
-    0x38, 0x8d, 0xf0, 0x2c, 0x38, 0x37, 0xa9, 0x89, 
-    0x50, 0x3e, 0x1e, 0xb3, 0x90, 0x4c, 0xb0, 0x94, 
-    0x87, 0xae, 0x1a, 0x25, 0x86, 0x0f, 0x7a, 0x6e, 
-    0x1b, 0xa2, 0x6a, 0x00, 0x13, 0x00, 0x2d, 0x81, 
-    0xdb, 0x53, 0xf6, 0x24, 0x52, 0x11, 0xf3, 0x68, 
-    0x5b, 0x8b, 0xf0, 0x9b, 0x52, 0x09, 0x19, 0x71, 
-    0x15, 0x0e, 0xbb, 0x36, 0x60, 0x9f, 0x8d, 0xd0, 
-    0x22, 0xa4, 0xdc, 0x62, 0xb4, 0xe0, 0x66, 0x5e, 
-    0x62, 0x8f, 0x11, 0x25, 0xb4, 0xae, 0x5f, 0x72, 
-    0x9a, 0xf0, 0xe0, 0x81, 0xa6, 0xb6, 0x2c, 0x51, 
-    0xcf, 0x5b, 0x23, 0x22, 0x1c, 0x28, 0xd7, 0xba, 
-    0x56, 0xdb, 0xe6, 0x51, 0x99, 0xf0, 0x10, 0x9f, 
-    0xd9, 0xf6, 0x0c, 0xb7, 0x1d, 0xc0, 0xa1, 0x7c, 
-    0xa2, 0xaa, 0x64, 0x31, 0x19, 0x58, 0x06, 0xbf, 
-    0xb5, 0xd4, 0xac, 0x71, 0x6f, 0x52, 0xa4, 0x3d, 
-    0x7a, 0xb7, 0xd3, 0x9c, 0x53, 0x14, 0x51, 0x93, 
-    0xd8, 0x22, 0x7d, 0x06, 0x37, 0xd9, 0x97, 0x3b, 
-    0x99, 0x68, 0xf5, 0x8c, 0x47, 0x3b, 0x28, 0xb5, 
-    0x4a, 0x46, 0xae, 0x0a, 0xda, 0xa6, 0x63, 0x11, 
-    0x05, 0xf0, 0x9c, 0x4f, 0x05, 0x62, 0xf0, 0x6e, 
-    0x5a, 0xff, 0x24, 0x8f, 0xb8, 0x21, 0x92, 0x45, 
-    0x17, 0xa2, 0xd6, 0xca, 0xfe, 0xee, 0xed, 0x4a, 
-    0x92, 0x8a, 0xf7, 0x81, 0x61, 0xa8, 0x20, 0x5b, 
-    0x55, 0xa2, 0xe4, 0x1b, 0x9e, 0xbe, 0x10, 0xa3, 
-    0x5a, 0x5e, 0xd1, 0x3a, 0x4d, 0x5f, 0xd8, 0x46, 
-    0xb3, 0x3c, 0xcc, 0x1d, 0x8c, 0x3b, 0x5b, 0x2a, 
-    0x42, 0x8c, 0x4b, 0x20, 0x49, 0x33, 0xcc, 0x85, 
-    0x86, 0x86, 0xed, 0xc0, 0xae, 0x70, 0x94, 0x56, 
-    0x66, 0x77, 0x48, 0x72, 0x28, 0x0a, 0x69, 0x30, 
-    0xfa, 0x82, 0x0e, 0x03, 0x8f, 0x2a, 0x79, 0x77, 
-    0x7e, 0x58, 0x69, 0x7f, 0xd8, 0xd2, 0x21, 0x11, 
-    0x09, 0x87, 0x1d, 0x2e, 0x48, 0x54, 0x00, 0x58, 
-    0xe8, 0xdb, 0x4f, 0xcc, 0x2b, 0x41, 0xf5, 0x3f, 
-    0xf1, 0xad, 0xd7, 0x3a, 0xd5, 0x67, 0xb5, 0x65, 
-    0x11, 0x3e, 0xd0, 0xd4, 0xaa, 0x54, 0x0d, 0xae, 
-    0xbc, 0x14, 0xc9, 0x56, 0xdc, 0x83, 0x56, 0x54, 
-    0x5e, 0x96, 0x2a, 0xb1, 0x8f, 0x27, 0x5a, 0x07, 
-    0xda, 0x92, 0x58, 0x23, 0x3d, 0xc0, 0x71, 0x6e, 
-    0xa1, 0xe3, 0x9a, 0x27, 0xbc, 0xd5, 0x49, 0x78, 
-    0x07, 0xf5, 0x67, 0x63, 0xdc, 0x8d, 0x3a, 0x63, 
-    0x2a, 0xd4, 0xbd, 0x6e, 0xe2, 0x5b, 0x07, 0x02, 
-    0xb0, 0x9c, 0x80, 0xd3, 0x03, 0xa6, 0x12, 0x70, 
-    0x9f, 0x66, 0xad, 0x6f, 0xe9, 0x11, 0x44, 0xc6, 
-    0x20, 0x5a, 0x4b, 0xa0, 0x39, 0xb6, 0x97, 0x62, 
-    0x40, 0x38, 0x01, 0x96, 0x2c, 0x8a, 0xba, 0x03, 
-    0xdd, 0xb7, 0xaf, 0x0f, 0x66, 0xea, 0xab, 0x3a, 
-    0x78, 0x8c, 0xbf, 0xaf, 0x15, 0x6b, 0x06, 0x08, 
-    0xbd, 0xb2, 0xa7, 0xc3, 0x83, 0x05, 0x0f, 0x6e, 
-    0xa2, 0x2b, 0xbf, 0x65, 0x41, 0x69, 0x63, 0x82, 
-    0x22, 0xcd, 0x4b, 0x5d, 0xd4, 0x9b, 0xb8, 0xb6, 
-    0x08, 0xdd, 0x46, 0x82, 0xd8, 0x5a, 0xaf, 0xa8, 
-    0xcf, 0xba, 0x7c, 0x3d, 0x1d, 0x30, 0x13, 0x04, 
-    0x09, 0x53, 0x55, 0x9c, 0x4d, 0xb4, 0x0d, 0x21, 
-    0x0b, 0xf3, 0x20, 0x5a, 0xaa, 0xac, 0x7a, 0x10, 
-    0x1b, 0x03, 0xfa, 0x04, 0xde, 0xa1, 0x32, 0xa0, 
-    0x27, 0x87, 0x4d, 0x12, 0x89, 0x71, 0x27, 0x2a, 
-    0x53, 0xb9, 0x1c, 0x0b, 0x46, 0x28, 0xad, 0x7f, 
-    0x19, 0x3b, 0xb1, 0x61, 0x41, 0x3f, 0x21, 0x57, 
-    0xbc, 0xea, 0xc6, 0x23, 0xe3, 0xaf, 0x91, 0xb3, 
-    0x37, 0x7b, 0xa6, 0x5c, 0xf0, 0xdf, 0x06, 0xa6, 
-    0x5f, 0xdb, 0xe8, 0x10, 0x31, 0xb0, 0xb8, 0xce, 
-    0xd9, 0xb3, 0x3f, 0xa3, 0xb6, 0xa6, 0x96, 0x08, 
-    0xe1, 0x09, 0x16, 0x6a, 0x65, 0x0e, 0xca, 0x45, 
-    0x9b, 0x17, 0x71, 0x7d, 0x48, 0x5e, 0xe5, 0x91, 
-    0x9d, 0xff, 0x18, 0x4f, 0x70, 0x88, 0x5d, 0xca, 
-    0x27, 0x1e, 0x52, 0xc2, 0x3f, 0xf8, 0x43, 0x71, 
-    0xa1, 0x1c, 0x3f, 0x2d, 0x43, 0x33, 0x33, 0x63, 
-    0x7a, 0x29, 0x31, 0xac, 0xc7, 0xc5, 0x92, 0xc2, 
-    0xfd, 0x5c, 0x24, 0x5c, 0x07, 0x3f, 0xd4, 0x93, 
-    0x7d, 0x9f, 0x03, 0x2f, 0x28, 0x8d, 0x4d, 0x5e, 
-    0x88, 0x93, 0xea, 0x3b, 0x2f, 0xc7, 0x9e, 0xaa, 
-    0x13, 0x17, 0x4c, 0x33, 0xeb, 0x96, 0x15, 0x58, 
-    0xb2, 0xbd, 0x22, 0x28, 0x9b, 0x6d, 0xcb, 0x67, 
-    0x3b, 0x60, 0x67, 0x22, 0x7d, 0xc2, 0xe4, 0x3b, 
-    0xfc, 0xce, 0x24, 0xd3, 0x31, 0x6a, 0x81, 0x97, 
-    0xeb, 0x4c, 0x41, 0x11, 0x5e, 0xd0, 0xa2, 0xb2, 
-    0x47, 0x42, 0x80, 0x67, 0x24, 0x94, 0x0f, 0xa5, 
-    0x6c, 0x57, 0x3f, 0xaf, 0xd7, 0xc4, 0xc2, 0xad, 
-    0xed, 0x6f, 0x8e, 0x4d, 0x53, 0x57, 0x90, 0x68, 
-    0x1b, 0x72, 0x84, 0xb2, 0xb9, 0xa5, 0xe7, 0x74, 
-    0x81, 0x45, 0x2e, 0x5f, 0xc2, 0xc8, 0x7d, 0x1e, 
-    0xeb, 0xdc, 0xff, 0xd6, 0xcb, 0xd0, 0x8d, 0xc6, 
-    0x08, 0x6b, 0xa9, 0x09, 0xf3, 0xce, 0x2f, 0x22, 
-    0xc2, 0xb6, 0xce, 0x22, 0x72, 0x47, 0xe7, 0x6a, 
-    0x9e, 0xc7, 0x66, 0x6d, 0x2b, 0x0b, 0x41, 0xb3, 
-    0xd3, 0xd7, 0xa1, 0x19, 0x48, 0x37, 0x17, 0x8a, 
-    0xb7, 0x1f, 0x37, 0x4e, 0x73, 0xdf, 0xa2, 0x2c, 
-    0x6f, 0x66, 0x6f, 0x78, 0x1b, 0xaa, 0x50, 0x55, 
-    0xca, 0xa6, 0xf3, 0xc3, 0xd4, 0x0e, 0x24, 0x0d, 
-    0xbe, 0x8b, 0xbf, 0x27, 0x36, 0x73, 0x76, 0x01, 
-    0x92, 0x57, 0xaf, 0x2c, 0x80, 0xe2, 0x2f, 0x08, 
-    0x9e, 0x81, 0x55, 0x83, 0x51, 0xc1, 0xfd, 0x37, 
-    0xd2, 0x6e, 0xad, 0xcc, 0x27, 0xb3, 0x7f, 0x74, 
-    0x39, 0x4d, 0x74, 0x3a, 0xd4, 0x20, 0x6b, 0x7c, 
-    0xcf, 0x2d, 0xed, 0xcc, 0x89, 0x7d, 0xab, 0x0c, 
-    0x6e, 0x04, 0x01, 0xca, 0x0f, 0x43, 0x4c, 0x5e, 
-    0x31, 0x6d, 0xe0, 0xc6, 0xee, 0x6d, 0x35, 0x2f, 
-    0x50, 0xe1, 0xb7, 0xb6, 0xc7, 0x9b, 0xb2, 0xbf, 
-    0x88, 0xe2, 0xc2, 0x63, 0xee, 0xba, 0x9c, 0x75, 
-    0xed, 0x45, 0x02, 0xd6, 0x88, 0x16, 0xaf, 0x90, 
-    0x3d, 0x64, 0x44, 0xb8, 0x2d, 0x86, 0xfc, 0x52, 
-    0xd0, 0x3b, 0xe6, 0xae, 0xc9, 0xa6, 0xde, 0x85, 
-    0xe0, 0x10, 0xc3, 0x65, 0x50, 0x8e, 0xfe, 0x63, 
-    0xc8, 0xfa, 0x78, 0x5b, 0xff, 0xc2, 0x58, 0x82, 
-    0xcb, 0xa9, 0xb1, 0x2e, 0x86, 0x2d, 0x53, 0x0f, 
-    0xa1, 0x27, 0xa9, 0x56, 0x7d, 0xfb, 0xb8, 0x63, 
-    0x40, 0x13, 0x7d, 0xb4, 0xa0, 0x91, 0x2e, 0x02, 
-    0x21, 0x3d, 0x75, 0x6f, 0xee, 0x94, 0xa8, 0x45, 
-    0x8d, 0x8a, 0x1c, 0x56, 0x43, 0xcf, 0xc9, 0x07, 
-    0x96, 0x06, 0x0f, 0x13, 0x58, 0x5a, 0xd5, 0x84, 
-    0xa0, 0x1f, 0x61, 0x6d, 0x41, 0x9f, 0x36, 0x82, 
-    0xd3, 0xd0, 0x81, 0x3d, 0x4c, 0xd7, 0xba, 0x37, 
-    0x8d, 0xf1, 0x98, 0xb8, 0x49, 0xcf, 0x81, 0x1c, 
-    0x9c, 0x80, 0x3a, 0x96, 0x93, 0x1b, 0xca, 0x96, 
-    0xe4, 0xfd, 0x3e, 0x63, 0x67, 0x24, 0xbf, 0x99, 
-    0x57, 0x35, 0x83, 0x52, 0xcc, 0xfb, 0xcd, 0xa1, 
-    0xe0, 0x33, 0x5e, 0x48, 0x56, 0xfd, 0xd5, 0xa2, 
-    0x85, 0x58, 0x90, 0x6e, 0xfc, 0xb6, 0x1b
-};
-static unsigned char xk1[] = {
-    0x7c, 0xd4, 0xe9, 0x7e, 0x86, 0xc0, 0x23, 0x74, 
-    0xb4, 0x2d, 0x53, 0x51, 0x0f, 0x76, 0x07, 0x3f, 
-    0xe7, 0x5f, 0xfb, 0xd6, 0x1e, 0x15, 0xac, 0x8e, 
-    0x32, 0x6b, 0xe9, 0xd6, 0x80, 0x42, 0x8c, 0x89
-};
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup4591761x25519test.c 20220801-1/crypto-tests/crypto_kem_sntrup4591761x25519test.c
--- 20190101-1/crypto-tests/crypto_kem_sntrup4591761x25519test.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup4591761x25519test.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,77 +0,0 @@
-/*
-20181229
-Jan Mojzis
-Public domain.
-*/
-
-#include "misc.h"
-#include "crypto_kem_sntrup4591761x25519.h"
-#include "crypto_kem_sntrup4591761x25519test.data"
-
-unsigned char sk[crypto_kem_sntrup4591761x25519_SECRETKEYBYTES + 16];
-unsigned char pk[crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES + 16];
-unsigned char c[crypto_kem_sntrup4591761x25519_CIPHERTEXTBYTES + 16];
-unsigned char k1[crypto_kem_sntrup4591761x25519_BYTES + 16];
-unsigned char k2[crypto_kem_sntrup4591761x25519_BYTES + 16];
-#define xk2 k2
-
-static void test_random(void) {
-
-    long long i, j;
-
-    for (i = 0; i < 16; ++i) {
-        if (crypto_kem_sntrup4591761x25519_keypair(pk + i, sk + i) != 0) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761x25519_SECRETKEYBYTES);
-            fail("crypto_kem_sntrup4591761x25519_keypair() failure, please report it !!!!!!!!!");
-        }
-        if (crypto_kem_sntrup4591761x25519_enc(c + i, k1 + i, pk + i) != 0) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761x25519_SECRETKEYBYTES);
-            fail_printdata("c", c + i, crypto_kem_sntrup4591761x25519_CIPHERTEXTBYTES);
-            fail_printdata("k1", k1 + i, crypto_kem_sntrup4591761x25519_BYTES);
-            fail("crypto_kem_sntrup4591761x25519_enc() failure, please report it !!!!!!!!!");
-        }
-        if (crypto_kem_sntrup4591761x25519_dec(k2 + i, c + i, sk + i) != 0) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761x25519_SECRETKEYBYTES);
-            fail_printdata("c", c + i, crypto_kem_sntrup4591761x25519_CIPHERTEXTBYTES);
-            fail_printdata("k1", k1 + i, crypto_kem_sntrup4591761x25519_BYTES);
-            fail_printdata("k2", k2 + i, crypto_kem_sntrup4591761x25519_BYTES);
-            fail("crypto_kem_sntrup4591761x25519_dec() failure, please report it !!!!!!!!!");
-        }
-        for (j = 0; j < crypto_kem_sntrup4591761x25519_BYTES; ++j) if (k1[i + j] != k2[i + j]) {
-            fail_printdata("pk", pk + i, crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES);
-            fail_printdata("sk", sk + i, crypto_kem_sntrup4591761x25519_SECRETKEYBYTES);
-            fail_printdata("c", c + i, crypto_kem_sntrup4591761x25519_CIPHERTEXTBYTES);
-            fail_printdata("k1", k1 + i, crypto_kem_sntrup4591761x25519_BYTES);
-            fail_printdata("k2", k2 + i, crypto_kem_sntrup4591761x25519_BYTES);
-            fail("crypto_kem_sntrup4591761x25519_dec() failure, please report it !!!!!!!!!");
-        }
-    }
-}
-
-static void test_dec(void) {
-
-    long long j;
-
-    if (crypto_kem_sntrup4591761x25519_dec(xk2, xc, xsk) != 0) {
-        fail_printdata("xk1", xk1, crypto_kem_sntrup4591761x25519_BYTES);
-        fail_printdata("xk2", xk2, crypto_kem_sntrup4591761x25519_BYTES);
-        fail("crypto_kem_sntrup4591761x25519_dec() failure, please report it !!!!!!!!!");
-    }
-    for (j = 0; j < crypto_kem_sntrup4591761x25519_BYTES; ++j) if (xk1[j] != xk2[j]) {
-        fail_printdata("xk1", xk1, crypto_kem_sntrup4591761x25519_BYTES);
-        fail_printdata("xk2", xk2, crypto_kem_sntrup4591761x25519_BYTES);
-        fail("crypto_kem_sntrup4591761x25519_dec() failure, please report it !!!!!!!!!");
-    }
-}
-
-
-int main(void) {
-
-    test_dec();
-    test_random();
-
-    _exit(0);
-}
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup4591761x25519test.data 20220801-1/crypto-tests/crypto_kem_sntrup4591761x25519test.data
--- 20190101-1/crypto-tests/crypto_kem_sntrup4591761x25519test.data	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup4591761x25519test.data	1970-01-01 00:00:00.000000000 +0000
@@ -1,353 +0,0 @@
-static unsigned char xsk[] = {
-    0x45, 0x55, 0x61, 0x58, 0x16, 0x56, 0x6a, 0x89, 
-    0x55, 0x55, 0x54, 0x5a, 0x65, 0x95, 0x15, 0x5a, 
-    0x50, 0x52, 0x25, 0x10, 0x55, 0x56, 0x55, 0x55, 
-    0x85, 0x96, 0x55, 0x96, 0x16, 0x65, 0x45, 0x59, 
-    0x41, 0x59, 0x05, 0x61, 0x66, 0x46, 0x15, 0x01, 
-    0x55, 0x98, 0x25, 0x85, 0x45, 0x55, 0x59, 0x15, 
-    0x65, 0x19, 0x55, 0x16, 0x81, 0x55, 0x16, 0x55, 
-    0xa9, 0x61, 0x65, 0x55, 0xa5, 0x99, 0x59, 0x95, 
-    0x99, 0x59, 0x59, 0x54, 0x20, 0x56, 0x49, 0x11, 
-    0x15, 0xa8, 0x65, 0x85, 0x64, 0x51, 0x61, 0x59, 
-    0x55, 0x95, 0x54, 0x94, 0x68, 0x95, 0xa4, 0x44, 
-    0x55, 0x49, 0x55, 0x59, 0x55, 0x55, 0x92, 0x51, 
-    0x64, 0x45, 0x45, 0xa5, 0x46, 0x59, 0x85, 0x50, 
-    0x64, 0x55, 0x91, 0x85, 0x49, 0x46, 0x54, 0x54, 
-    0x46, 0x40, 0x50, 0x59, 0x95, 0x25, 0x59, 0xa2, 
-    0x55, 0x99, 0xa5, 0x59, 0x05, 0x64, 0x54, 0x51, 
-    0x65, 0x51, 0x24, 0x65, 0x51, 0x69, 0x96, 0x59, 
-    0xa5, 0x69, 0x5a, 0x55, 0x5a, 0x19, 0x54, 0x59, 
-    0x25, 0x55, 0x15, 0x44, 0x12, 0x5a, 0x55, 0x51, 
-    0x54, 0x96, 0x55, 0x55, 0x4a, 0x42, 0x25, 0x66, 
-    0x15, 0x50, 0x96, 0xa0, 0x45, 0x50, 0x14, 0x55, 
-    0x55, 0x56, 0x55, 0x55, 0x46, 0x5a, 0x95, 0x12, 
-    0x52, 0xa6, 0x61, 0x55, 0x96, 0x69, 0x55, 0x41, 
-    0x66, 0x44, 0x89, 0x45, 0x1a, 0x55, 0x00, 0x06, 
-    0x84, 0x06, 0xa2, 0x89, 0xa9, 0xaa, 0xaa, 0x28, 
-    0x12, 0x06, 0xa0, 0x56, 0x80, 0x68, 0x16, 0x56, 
-    0x64, 0x2a, 0x02, 0xa5, 0x29, 0x22, 0x56, 0x89, 
-    0x41, 0x80, 0x00, 0x50, 0x41, 0x92, 0x16, 0xaa, 
-    0x49, 0xa4, 0x10, 0x15, 0x58, 0x94, 0x16, 0x2a, 
-    0x68, 0x68, 0x88, 0xa1, 0x56, 0x84, 0x25, 0x41, 
-    0x8a, 0x6a, 0x61, 0x41, 0x51, 0x18, 0x11, 0x6a, 
-    0x84, 0x59, 0x00, 0x90, 0x44, 0x59, 0xa2, 0x29, 
-    0x6a, 0x4a, 0x1a, 0x99, 0x80, 0x24, 0x02, 0x98, 
-    0x42, 0x96, 0xa1, 0x0a, 0x65, 0x01, 0x96, 0x99, 
-    0x1a, 0x10, 0x62, 0x60, 0x06, 0x86, 0x45, 0x29, 
-    0x81, 0x60, 0x89, 0x1a, 0x89, 0x80, 0x00, 0x02, 
-    0x04, 0x5a, 0x42, 0x01, 0x89, 0x88, 0x62, 0x92, 
-    0x22, 0xa8, 0x29, 0x94, 0x18, 0x0a, 0x9a, 0x91, 
-    0x86, 0xa9, 0x24, 0x89, 0x19, 0x54, 0x09, 0x92, 
-    0xa5, 0x12, 0x84, 0x44, 0x98, 0xa8, 0x80, 0x55, 
-    0xa5, 0x40, 0x11, 0x06, 0xa4, 0x16, 0x62, 0x1a, 
-    0x94, 0x8a, 0x24, 0x54, 0x94, 0x94, 0xa4, 0x54, 
-    0x1a, 0x06, 0x05, 0x22, 0x82, 0x42, 0x18, 0x56, 
-    0x54, 0x99, 0x82, 0x14, 0x06, 0x01, 0x61, 0x82, 
-    0xa2, 0xa4, 0x65, 0x61, 0x48, 0x59, 0x91, 0x48, 
-    0xa0, 0x26, 0x64, 0x05, 0x1a, 0x48, 0x10, 0x15, 
-    0x0a, 0x8a, 0x49, 0x92, 0x2a, 0x69, 0x61, 0x65, 
-    0x85, 0x18, 0x12, 0x90, 0x58, 0x00, 0xae, 0x0d, 
-    0x0b, 0xf5, 0xa0, 0xc4, 0xda, 0x47, 0x73, 0x81, 
-    0xdd, 0x69, 0x0f, 0x9c, 0x44, 0x2e, 0xae, 0x96, 
-    0x1d, 0xcf, 0x41, 0x67, 0xba, 0x2b, 0x6d, 0x34, 
-    0x81, 0xf7, 0xb6, 0xd2, 0x6b, 0x55, 0xd4, 0x5a, 
-    0x23, 0x43, 0x6a, 0x2f, 0x42, 0x17, 0xfa, 0x77, 
-    0xdb, 0x0d, 0x67, 0x04, 0xff, 0x55, 0x1d, 0x0c, 
-    0xd5, 0xeb, 0xd6, 0xe9, 0x74, 0x1e, 0xb0, 0xb4, 
-    0x20, 0x0b, 0xba, 0x43, 0xf3, 0x3e, 0xe0, 0x8c, 
-    0x35, 0xa8, 0x92, 0x04, 0x27, 0x4b, 0xb2, 0x1e, 
-    0x8d, 0x4d, 0xf2, 0x3b, 0x97, 0x11, 0xc0, 0x0b, 
-    0x83, 0xed, 0xe4, 0xab, 0x91, 0x4e, 0x09, 0x4e, 
-    0xde, 0x65, 0x0f, 0xe6, 0x0a, 0x39, 0x48, 0xa2, 
-    0xb1, 0x6d, 0xcc, 0x6d, 0xa3, 0x2c, 0x32, 0x18, 
-    0x85, 0xd6, 0xf0, 0x77, 0x69, 0x2f, 0x6b, 0xfa, 
-    0xb7, 0x4c, 0x8a, 0x19, 0xe4, 0x04, 0x95, 0xd7, 
-    0x5f, 0x66, 0x15, 0x75, 0x9d, 0x44, 0x03, 0x64, 
-    0x0e, 0xa3, 0x5b, 0x9d, 0x70, 0x3c, 0xf2, 0x1f, 
-    0x9a, 0x6b, 0x52, 0x79, 0x0a, 0x3b, 0x50, 0xc4, 
-    0x0c, 0x8a, 0x35, 0xd7, 0xd7, 0x03, 0xab, 0xe0, 
-    0x06, 0x6c, 0xf1, 0xd6, 0xbe, 0x03, 0x9e, 0x75, 
-    0x0c, 0xe6, 0x4c, 0xee, 0x5d, 0x3d, 0x3d, 0x68, 
-    0xf0, 0xac, 0x06, 0xa8, 0x25, 0x4f, 0x1a, 0x8b, 
-    0xa3, 0xac, 0x2b, 0x97, 0x40, 0x18, 0x2d, 0xca, 
-    0x57, 0x67, 0x0b, 0x7f, 0x87, 0x41, 0xc6, 0xf3, 
-    0xdb, 0x43, 0x5a, 0x14, 0xd7, 0x19, 0x19, 0x0c, 
-    0x71, 0xb5, 0xd6, 0x16, 0x31, 0x16, 0x95, 0x11, 
-    0x88, 0x2f, 0xc9, 0xe7, 0xcf, 0x07, 0xc8, 0xb9, 
-    0x85, 0xcb, 0x7c, 0xdd, 0xc3, 0x2d, 0x64, 0xc0, 
-    0x4a, 0x27, 0xfc, 0x62, 0x36, 0x57, 0xb9, 0x4b, 
-    0x22, 0x54, 0x68, 0x49, 0x55, 0x36, 0x84, 0x92, 
-    0x7b, 0x6f, 0xe4, 0xb1, 0x91, 0x59, 0xec, 0xa1, 
-    0x92, 0xcd, 0x89, 0x49, 0xa3, 0x40, 0x6f, 0x71, 
-    0x45, 0x81, 0x74, 0x6c, 0xa0, 0x54, 0x20, 0xbe, 
-    0x83, 0xf2, 0xfc, 0x40, 0x2f, 0x2e, 0xa4, 0xa7, 
-    0x04, 0x58, 0x5e, 0x67, 0x42, 0x00, 0x46, 0xf8, 
-    0x52, 0x82, 0xec, 0x88, 0x6d, 0x24, 0x4b, 0x72, 
-    0xd1, 0xbe, 0xeb, 0x07, 0xd8, 0x21, 0x6d, 0xb7, 
-    0x1e, 0x91, 0x56, 0x50, 0x67, 0x46, 0x0d, 0x24, 
-    0x06, 0xa8, 0x22, 0xe8, 0x9d, 0x3c, 0x63, 0xed, 
-    0x1a, 0x89, 0x9e, 0xa8, 0x04, 0x1f, 0x41, 0xe1, 
-    0x97, 0xf6, 0xec, 0x0a, 0xb8, 0x3a, 0x83, 0xfb, 
-    0x04, 0xf8, 0x35, 0x36, 0xf5, 0x3e, 0xaf, 0x99, 
-    0x68, 0x99, 0xe0, 0x04, 0xad, 0x3c, 0x52, 0x24, 
-    0xf3, 0xaf, 0x77, 0x41, 0x6a, 0x42, 0xc1, 0x39, 
-    0x78, 0xf4, 0x36, 0xc1, 0xfd, 0x51, 0x64, 0xeb, 
-    0x18, 0x82, 0x56, 0x7d, 0xf2, 0x24, 0x6b, 0x28, 
-    0xa0, 0xac, 0xba, 0x32, 0x3b, 0x14, 0x28, 0x35, 
-    0x62, 0xfb, 0xb1, 0xc0, 0xc3, 0x1c, 0x3d, 0x83, 
-    0x8c, 0x7d, 0x4a, 0x0a, 0xe4, 0x3c, 0x4b, 0x71, 
-    0x46, 0xbc, 0x7b, 0x1f, 0x23, 0x0a, 0x31, 0x91, 
-    0x0d, 0x81, 0x0c, 0x5b, 0xb5, 0x46, 0x2c, 0x83, 
-    0xca, 0xb6, 0x1a, 0x54, 0x98, 0x45, 0xd9, 0x7f, 
-    0xe0, 0x70, 0x88, 0x3c, 0xcb, 0x39, 0x47, 0xf6, 
-    0xe2, 0x28, 0x3e, 0xb3, 0x7a, 0x40, 0x38, 0x14, 
-    0xe8, 0xec, 0x78, 0x85, 0x81, 0x49, 0xdf, 0x20, 
-    0x81, 0x41, 0xf3, 0x15, 0x99, 0x20, 0xa9, 0x08, 
-    0xd2, 0x70, 0xed, 0x6e, 0xfc, 0x29, 0xc1, 0xb1, 
-    0x35, 0x04, 0xd9, 0xc3, 0xfb, 0x2a, 0xb0, 0x1f, 
-    0x6d, 0x21, 0x0d, 0x22, 0xba, 0x29, 0xc9, 0xb6, 
-    0x50, 0xa2, 0x19, 0xad, 0xbc, 0x12, 0xe9, 0x49, 
-    0x79, 0x97, 0xb9, 0x69, 0x4c, 0x18, 0x0c, 0x6e, 
-    0xc6, 0xed, 0x76, 0x0d, 0x1b, 0x07, 0xb5, 0x63, 
-    0xe2, 0x60, 0x4c, 0xf1, 0x0c, 0x00, 0x82, 0x8e, 
-    0x34, 0x6a, 0x2d, 0xa2, 0xa7, 0x48, 0xda, 0x44, 
-    0x3c, 0x38, 0xe5, 0x9e, 0xf1, 0x4f, 0xfd, 0x66, 
-    0xff, 0x40, 0x84, 0xbc, 0xee, 0x20, 0x8e, 0x56, 
-    0x0e, 0xae, 0x72, 0x6c, 0x66, 0x4c, 0xee, 0x81, 
-    0xbc, 0x14, 0xe4, 0xaa, 0x26, 0x36, 0x85, 0xdf, 
-    0xd2, 0x93, 0x56, 0xb2, 0x52, 0x17, 0x66, 0x71, 
-    0x25, 0x70, 0xaa, 0x39, 0x44, 0x18, 0x9c, 0x1e, 
-    0xaa, 0xe2, 0xda, 0x4f, 0x15, 0x20, 0xc2, 0xd1, 
-    0x2d, 0x45, 0x64, 0x79, 0xdd, 0x36, 0x70, 0xee, 
-    0x10, 0x5e, 0x99, 0xba, 0x33, 0x1e, 0x6b, 0xa1, 
-    0x9d, 0x40, 0xb4, 0xc7, 0xfb, 0x28, 0x65, 0x82, 
-    0x3e, 0x9f, 0x6d, 0x0a, 0x6d, 0x1d, 0xbd, 0x58, 
-    0x5b, 0xac, 0xdf, 0x7e, 0x92, 0x2f, 0x7c, 0x80, 
-    0x80, 0xc3, 0x44, 0x5e, 0x92, 0x4d, 0x2d, 0xe9, 
-    0x86, 0x18, 0x9f, 0x03, 0x06, 0x32, 0x6c, 0x53, 
-    0x1f, 0x14, 0x95, 0xe5, 0xf3, 0x48, 0xbe, 0x77, 
-    0xf1, 0x60, 0x0d, 0xf3, 0xed, 0x0f, 0x90, 0x66, 
-    0x5f, 0x70, 0xc3, 0xc7, 0xc8, 0x24, 0xfb, 0x9d, 
-    0x0d, 0x09, 0xc4, 0xd2, 0x96, 0x44, 0x1c, 0x22, 
-    0x0c, 0xb1, 0xce, 0x9a, 0xe5, 0x47, 0x71, 0x89, 
-    0x6a, 0x99, 0xda, 0x88, 0x5d, 0x5a, 0x67, 0x24, 
-    0x72, 0x94, 0x8d, 0xc7, 0x7a, 0x23, 0xb3, 0xf7, 
-    0xd2, 0xa5, 0x03, 0xd0, 0x88, 0x19, 0x72, 0x09, 
-    0x1d, 0x61, 0x3f, 0xf3, 0xae, 0x08, 0x42, 0x13, 
-    0x4a, 0x60, 0xae, 0xe8, 0x98, 0x48, 0x14, 0x35, 
-    0xbb, 0x05, 0xc8, 0x38, 0xc8, 0x0e, 0xd8, 0x35, 
-    0x16, 0xae, 0x6c, 0x99, 0x4a, 0x32, 0x5c, 0x28, 
-    0x5f, 0x32, 0xfe, 0xe5, 0xd2, 0x56, 0x25, 0x77, 
-    0x99, 0x4d, 0xa1, 0x30, 0xbc, 0x58, 0x63, 0x7f, 
-    0xc3, 0x6d, 0x7d, 0x5f, 0x72, 0x34, 0x4e, 0x40, 
-    0xa3, 0x89, 0xdd, 0x8e, 0xf9, 0x4e, 0x76, 0x12, 
-    0xc2, 0xc9, 0xc1, 0xa0, 0x6d, 0x2a, 0xcf, 0x05, 
-    0x43, 0xaa, 0x07, 0xa0, 0x71, 0x55, 0xd6, 0xbb, 
-    0xba, 0xd2, 0x57, 0x66, 0x4d, 0x0b, 0x70, 0x2e, 
-    0xd4, 0x23, 0xdb, 0xa8, 0xb8, 0x38, 0xd9, 0xc4, 
-    0xc0, 0xfe, 0xbb, 0x8a, 0x67, 0x4f, 0xe7, 0xc5, 
-    0x64, 0x99, 0xcb, 0x73, 0xed, 0x38, 0x8e, 0xbb, 
-    0x87, 0x0d, 0x54, 0xdd, 0x81, 0x13, 0xd0, 0x22, 
-    0x21, 0xb5, 0xb2, 0xcf, 0x2e, 0x09, 0x0e, 0x92, 
-    0xe9, 0x41, 0x97, 0x4a, 0xd4, 0x02, 0xda, 0x04, 
-    0x47, 0x70, 0x58, 0xe2, 0x89, 0x1a, 0xfe, 0x7f, 
-    0x61, 0xeb, 0xce, 0x5c, 0x1e, 0x24, 0x1e, 0x59, 
-    0x84, 0xc5, 0x6c, 0x89, 0xb1, 0x33, 0xb0, 0xd8, 
-    0x79, 0xb3, 0x84, 0xb2, 0x1a, 0x20, 0x8f, 0xfe, 
-    0x4f, 0x36, 0xd1, 0x6b, 0xdf, 0x09, 0x8a, 0x2f, 
-    0x08, 0x3b, 0xa3, 0x50, 0x5f, 0x32, 0x8f, 0xf0, 
-    0x59, 0xb4, 0xac, 0xe3, 0x1a, 0x3f, 0xb2, 0x8f, 
-    0xb0, 0x4c, 0x24, 0xba, 0x51, 0x3b, 0xd1, 0xde, 
-    0x4b, 0x51, 0x83, 0xc7, 0x27, 0x32, 0xa7, 0x27, 
-    0x47, 0x9a, 0xc7, 0x57, 0xba, 0x18, 0xde, 0xdb, 
-    0x24, 0x3c, 0x4c, 0x7d, 0x14, 0x1b, 0xad, 0x68, 
-    0x2e, 0x96, 0x56, 0xc6, 0xce, 0x44, 0x1b, 0xbc, 
-    0x00, 0xb5, 0x52, 0xd3, 0xf4, 0x4c, 0x6f, 0xc8, 
-    0xeb, 0x53, 0x2c, 0x49, 0x75, 0x4c, 0xa5, 0xca, 
-    0x60, 0xc2, 0x50, 0x90, 0x7b, 0x1e, 0x83, 0x7e, 
-    0x73, 0x89, 0xc7, 0xa5, 0x3b, 0x44, 0x26, 0x66, 
-    0x07, 0x93, 0xc3, 0xdf, 0x2f, 0x0b, 0x20, 0x83, 
-    0xc4, 0x9b, 0x2b, 0x30, 0xf6, 0x0c, 0x13, 0xa4, 
-    0x3f, 0x98, 0x42, 0x84, 0xa4, 0x25, 0x6b, 0x87, 
-    0xd9, 0x14, 0x26, 0x27, 0xe1, 0x08, 0x8d, 0xb2, 
-    0xae, 0xe4, 0xe5, 0xf3, 0x69, 0x50, 0x08, 0xc7, 
-    0x7b, 0xdf, 0x2d, 0x5b, 0x18, 0x16, 0x1c, 0x19, 
-    0xe6, 0x6e, 0xfb, 0xa4, 0x47, 0x4b, 0x4c, 0x4d, 
-    0x98, 0x25, 0xac, 0x12, 0xca, 0x4b, 0xfe, 0x13, 
-    0x57, 0x44, 0x76, 0x40, 0xdd, 0x1a, 0xe5, 0x92, 
-    0x7f, 0xde, 0x51, 0x82, 0x49, 0x56, 0x8a, 0x52, 
-    0xea, 0xfd, 0x96, 0x6b, 0x19, 0x02, 0x15, 0x1e, 
-    0x11, 0x35, 0x08, 0x5d, 0x5f, 0x49, 0x05, 0xa5, 
-    0x66, 0x19, 0x51, 0xb1, 0x48, 0x07, 0xe0, 0x57, 
-    0x85, 0x3f, 0xd4, 0x4d, 0x01, 0x39, 0xa6, 0xa7, 
-    0xb8, 0x0c, 0x12, 0x75, 0x48, 0x45, 0x9a, 0xa1, 
-    0x08, 0x85, 0x24, 0xdc, 0x81, 0x3a, 0x14, 0x27, 
-    0x73, 0x2f, 0x8a, 0xd9, 0x5d, 0x23, 0x3c, 0xd2, 
-    0x4a, 0x83, 0xe1, 0xc2, 0x97, 0x0d, 0x92, 0x06, 
-    0xd3, 0x79, 0x5e, 0xa3, 0x22, 0x13, 0x9d, 0xbe, 
-    0xbd, 0x04, 0xeb, 0x42, 0x86, 0x03, 0x21, 0x4b, 
-    0x02, 0xa4, 0xf5, 0x11, 0x5a, 0x4e, 0x04, 0x23, 
-    0x20, 0x09, 0x87, 0x96, 0xf4, 0x48, 0x8a, 0x49, 
-    0xf5, 0xb5, 0x60, 0x94, 0x33, 0x09, 0x28, 0x28, 
-    0x46, 0x41, 0x5c, 0x98, 0x2d, 0x3c, 0x16, 0x1f, 
-    0x4e, 0x4e, 0x44, 0xed, 0x4d, 0x1c, 0xcf, 0x04, 
-    0x5e, 0xae, 0xc3, 0x20, 0x4b, 0x03, 0xd3, 0x92, 
-    0xa6, 0xb2, 0x9f, 0x5b, 0x97, 0x32, 0xd4, 0xa6, 
-    0x8b, 0xa7, 0x50, 0x19, 0x68, 0x3c, 0xcd, 0xde, 
-    0x88, 0xc6, 0xf9, 0xc4, 0x1e, 0x43, 0x48, 0xdb, 
-    0x4d, 0x56, 0x24, 0x0a, 0xe5, 0x2c, 0xd8, 0x33, 
-    0x16, 0xf5, 0x27, 0x32, 0x9d, 0x0f, 0x1c, 0x41, 
-    0x25, 0xe3, 0xaf, 0x5e, 0x6b, 0x2b, 0x73, 0x81, 
-    0x0a, 0xe6, 0xfb, 0xfe, 0x9e, 0x2a, 0xbd, 0x05, 
-    0x16, 0x91, 0xf2, 0xc5, 0x2e, 0x65, 0x75, 0x55, 
-    0x5f, 0xa7, 0x58, 0xf1, 0x68, 0x0c, 0xc6, 0x55, 
-    0x5a, 0x6b, 0x91, 0xcd, 0x30, 0x7e, 0xb8, 0x96, 
-    0x04, 0x5b, 0x38, 0x57, 0x1d, 0x12, 0x5d, 0xb7
-};
-static unsigned char xc[] = {
-    0x3d, 0x7c, 0x4b, 0x26, 0x34, 0xe2, 0xcd, 0x36, 
-    0x89, 0x67, 0xdd, 0xe2, 0x2a, 0x46, 0xfe, 0x9b, 
-    0xb1, 0x07, 0x80, 0xe0, 0xa5, 0x6e, 0x60, 0x1e, 
-    0x0a, 0x07, 0xcc, 0x99, 0xe0, 0xcb, 0x63, 0x82, 
-    0x76, 0x46, 0xf7, 0x48, 0x7d, 0x95, 0x53, 0x1a, 
-    0x79, 0x53, 0xcd, 0xc6, 0xa8, 0x77, 0x76, 0x0c, 
-    0x42, 0x00, 0x90, 0x04, 0x0a, 0x8c, 0x54, 0x25, 
-    0xd4, 0x5b, 0xcb, 0x65, 0x7f, 0xfb, 0xe7, 0x6a, 
-    0x43, 0x86, 0x85, 0xa2, 0xec, 0x34, 0x16, 0x0f, 
-    0xab, 0x41, 0xb8, 0x28, 0xde, 0xb1, 0xb0, 0x70, 
-    0x3d, 0xef, 0xec, 0x04, 0xf7, 0xd1, 0x9c, 0x09, 
-    0x0c, 0xe7, 0x00, 0x71, 0x32, 0x67, 0x54, 0x2d, 
-    0xd6, 0x88, 0xe7, 0xc1, 0x1c, 0x40, 0x45, 0x0e, 
-    0x6d, 0x4f, 0xbf, 0xb6, 0x87, 0xe6, 0xea, 0x64, 
-    0x86, 0x5a, 0xf2, 0x2b, 0x03, 0x27, 0xe2, 0x7b, 
-    0x5a, 0xb0, 0xaf, 0x7f, 0xde, 0x96, 0xc9, 0x4d, 
-    0xac, 0x94, 0xb7, 0x9e, 0x2e, 0xf1, 0xdf, 0x0b, 
-    0x2a, 0x5e, 0xef, 0x53, 0x5f, 0xd6, 0xb4, 0xad, 
-    0xf8, 0x38, 0xf6, 0xac, 0x09, 0xb7, 0xe6, 0x7f, 
-    0x97, 0x33, 0x53, 0xb5, 0x8b, 0xa0, 0x71, 0x78, 
-    0xb4, 0x7b, 0x0f, 0x96, 0x32, 0x6f, 0x37, 0x10, 
-    0x90, 0xd4, 0x37, 0x6e, 0xec, 0x8f, 0x56, 0xba, 
-    0x79, 0x37, 0x81, 0x8c, 0x91, 0xe0, 0xca, 0xa1, 
-    0xdc, 0x21, 0x17, 0x3b, 0x6b, 0x66, 0x9e, 0xb6, 
-    0x25, 0xaf, 0x40, 0x64, 0x12, 0x8c, 0x44, 0x9a, 
-    0x2b, 0x36, 0xcc, 0x8c, 0x04, 0x2f, 0x0a, 0x19, 
-    0x4c, 0x2b, 0x0e, 0xce, 0xf3, 0x57, 0xdb, 0x9b, 
-    0x6b, 0x22, 0xd1, 0x7e, 0xe0, 0xbc, 0x97, 0x45, 
-    0x91, 0xa8, 0x9e, 0x5f, 0x2f, 0x46, 0xcb, 0x50, 
-    0xea, 0x5e, 0xff, 0x83, 0x8a, 0x53, 0xc0, 0x12, 
-    0x4d, 0x35, 0x5c, 0x03, 0x13, 0x84, 0x50, 0x59, 
-    0xcc, 0x9b, 0x30, 0x2e, 0xab, 0xc2, 0x6d, 0x5e, 
-    0x78, 0x58, 0x2e, 0xa7, 0xbd, 0x05, 0x59, 0xa4, 
-    0xd7, 0x01, 0xf0, 0x9c, 0xbc, 0xd8, 0xc2, 0x7e, 
-    0xa4, 0xeb, 0x21, 0x1d, 0xcc, 0xa0, 0x95, 0x71, 
-    0x78, 0x86, 0xd9, 0x05, 0xd4, 0xae, 0x46, 0x12, 
-    0xa3, 0x8c, 0xbf, 0x22, 0xf2, 0x9c, 0x6b, 0xce, 
-    0x90, 0x3e, 0x85, 0xc7, 0x4c, 0x78, 0x1e, 0x65, 
-    0xb0, 0x43, 0x0a, 0x23, 0xc1, 0x63, 0x00, 0x4d, 
-    0xc5, 0x38, 0x5f, 0x28, 0xa6, 0x61, 0x21, 0x81, 
-    0xe5, 0xd6, 0x43, 0x6c, 0xbd, 0x9a, 0x9f, 0x56, 
-    0xc6, 0x1d, 0xe6, 0x20, 0x5e, 0x7a, 0x45, 0x0c, 
-    0x60, 0x57, 0x7b, 0x7e, 0x3d, 0xc1, 0x64, 0xb6, 
-    0xfd, 0xa3, 0xd4, 0xaf, 0x2a, 0xe7, 0x39, 0x79, 
-    0x27, 0x6e, 0x02, 0xb6, 0x47, 0xa7, 0xdb, 0xa5, 
-    0x2b, 0x94, 0xe7, 0x03, 0x62, 0x1c, 0x11, 0xa0, 
-    0x42, 0xe8, 0x0b, 0x88, 0x66, 0x14, 0x76, 0x0e, 
-    0xbf, 0x69, 0x11, 0x47, 0x84, 0x23, 0xe0, 0x28, 
-    0xa8, 0xf2, 0x34, 0xb7, 0xe8, 0xd9, 0x14, 0x95, 
-    0x92, 0x8b, 0xa4, 0x41, 0xe7, 0x6c, 0x8b, 0x0b, 
-    0x86, 0xc6, 0x2c, 0x6b, 0x87, 0x45, 0xab, 0x8e, 
-    0x78, 0x44, 0x50, 0x94, 0x1a, 0x1d, 0x7d, 0x0c, 
-    0x80, 0x28, 0x1b, 0x71, 0x43, 0xd9, 0x05, 0x79, 
-    0x77, 0xed, 0x40, 0xbc, 0x31, 0x6f, 0x26, 0x77, 
-    0x4e, 0x8b, 0xb4, 0x5d, 0xbc, 0x8d, 0x35, 0x23, 
-    0x77, 0x59, 0xf9, 0xaa, 0x30, 0x0e, 0x9c, 0x88, 
-    0x18, 0x3e, 0x0b, 0x20, 0x5c, 0x6b, 0x3d, 0x27, 
-    0xa9, 0x41, 0xa9, 0x2d, 0x1e, 0x9a, 0x27, 0xa4, 
-    0x6b, 0x68, 0x78, 0xa1, 0x02, 0x49, 0xca, 0xb0, 
-    0x06, 0x2a, 0x73, 0xa7, 0xde, 0xf9, 0xb5, 0x84, 
-    0x12, 0xd2, 0x98, 0x86, 0x6f, 0xf9, 0x11, 0x22, 
-    0x1e, 0xd7, 0x8e, 0xac, 0xca, 0xbb, 0x09, 0x11, 
-    0x7e, 0x8a, 0x14, 0x87, 0x06, 0x67, 0x1d, 0xa5, 
-    0x75, 0x55, 0x4c, 0xb9, 0x4a, 0x77, 0x2f, 0x77, 
-    0xa4, 0xab, 0x84, 0xb0, 0xbe, 0x94, 0x3a, 0x5d, 
-    0xdd, 0xd2, 0x79, 0x02, 0xf8, 0xa6, 0xb4, 0xa8, 
-    0xf3, 0xe3, 0xb6, 0x42, 0x56, 0xdc, 0xd9, 0xc7, 
-    0x84, 0x37, 0x66, 0xb4, 0xf3, 0xa1, 0x6d, 0xb8, 
-    0x7f, 0x4e, 0x7f, 0x17, 0x4d, 0xda, 0x49, 0x13, 
-    0x67, 0xb3, 0xba, 0xc3, 0x75, 0x51, 0x35, 0x51, 
-    0x49, 0x6f, 0x5e, 0x47, 0x23, 0x61, 0x86, 0x19, 
-    0xb8, 0xdd, 0x51, 0xd2, 0xf7, 0x9a, 0x79, 0x7a, 
-    0xbc, 0x57, 0xfb, 0xc5, 0x98, 0x2d, 0xb3, 0xa0, 
-    0xbc, 0x0a, 0x38, 0x6b, 0xae, 0x2c, 0x51, 0x65, 
-    0x6b, 0xbe, 0x6a, 0xa7, 0x2a, 0xdc, 0x11, 0x9d, 
-    0x1f, 0x0a, 0x57, 0xc4, 0x6d, 0xe3, 0xf6, 0x36, 
-    0xcc, 0x60, 0x61, 0x80, 0x79, 0x95, 0x5b, 0x45, 
-    0x34, 0x4e, 0x7c, 0x57, 0x05, 0x91, 0x55, 0xa5, 
-    0xc6, 0x5b, 0xcc, 0x5a, 0xc0, 0x8c, 0xfa, 0x1a, 
-    0x5e, 0xd3, 0xd4, 0xca, 0xce, 0x39, 0xb0, 0x9f, 
-    0x7f, 0x4a, 0xec, 0xb8, 0x2e, 0x6d, 0xdf, 0x5d, 
-    0x3c, 0x22, 0xcf, 0x82, 0x02, 0xb6, 0x6b, 0xc6, 
-    0x52, 0xd9, 0x73, 0x3f, 0x55, 0x24, 0x91, 0x4d, 
-    0xb4, 0x19, 0x05, 0x11, 0x54, 0xa8, 0xdf, 0x52, 
-    0xba, 0x59, 0x0b, 0xd1, 0x35, 0x2a, 0x3c, 0x1f, 
-    0x9a, 0x08, 0x3e, 0xae, 0xae, 0xdb, 0xef, 0xa9, 
-    0xf0, 0xd7, 0x11, 0xac, 0xb0, 0x39, 0xcf, 0xb1, 
-    0x54, 0x7c, 0x51, 0x17, 0x76, 0xd2, 0x72, 0x13, 
-    0xd2, 0x38, 0x95, 0xae, 0x61, 0x61, 0x6f, 0xb7, 
-    0x5d, 0x42, 0x6c, 0x69, 0x09, 0xd8, 0xaa, 0x69, 
-    0x54, 0xa0, 0xb6, 0xa2, 0xf3, 0x3b, 0x4f, 0xc2, 
-    0xc3, 0xb0, 0xae, 0x8b, 0x0b, 0xe1, 0x1f, 0x1b, 
-    0x46, 0xc8, 0xbc, 0x57, 0xc1, 0x1d, 0x2b, 0xc2, 
-    0x3b, 0x06, 0xd3, 0xd4, 0xb4, 0x44, 0xf5, 0xd6, 
-    0xb7, 0x72, 0xff, 0x0a, 0x35, 0x47, 0x18, 0x1d, 
-    0x85, 0x0b, 0x54, 0xd0, 0x3c, 0x21, 0x17, 0x2f, 
-    0x90, 0x6b, 0x60, 0x15, 0x06, 0x77, 0x18, 0x35, 
-    0x94, 0x18, 0x10, 0x3d, 0x97, 0x47, 0x35, 0x7f, 
-    0xa1, 0x98, 0x5f, 0xb7, 0xba, 0x56, 0x7b, 0x9d, 
-    0xd6, 0xb8, 0x66, 0x80, 0xc0, 0xae, 0x8f, 0x7a, 
-    0xaa, 0x12, 0x06, 0x5c, 0x3b, 0x6f, 0x9c, 0x0a, 
-    0x65, 0xea, 0x61, 0xc5, 0xa7, 0xf4, 0xf8, 0xaa, 
-    0xa1, 0x70, 0xa3, 0x22, 0x05, 0x2b, 0xcc, 0x48, 
-    0xab, 0x79, 0x9b, 0x3d, 0xd1, 0xaf, 0x92, 0xc0, 
-    0x02, 0x93, 0xc8, 0x27, 0x77, 0x34, 0x87, 0x15, 
-    0x5b, 0xe7, 0x88, 0x42, 0x6b, 0xb7, 0xd2, 0xbf, 
-    0xcb, 0x05, 0x0e, 0x01, 0x19, 0x78, 0x48, 0x96, 
-    0x46, 0xf1, 0x63, 0x1a, 0x0e, 0x02, 0x2b, 0x12, 
-    0xf7, 0x27, 0xe9, 0x93, 0xf3, 0xdd, 0x42, 0x20, 
-    0x3d, 0xc0, 0xff, 0x46, 0x0e, 0x73, 0x7b, 0x73, 
-    0x34, 0x19, 0xa5, 0xd1, 0xa9, 0xc1, 0x44, 0x56, 
-    0xea, 0xf7, 0xcb, 0x72, 0x6c, 0x09, 0x69, 0x82, 
-    0x76, 0x8f, 0x31, 0xcb, 0x0e, 0x73, 0x53, 0x11, 
-    0xc3, 0xcd, 0x01, 0x77, 0xd5, 0xeb, 0xd2, 0x36, 
-    0xb9, 0xcd, 0xb8, 0x0b, 0xab, 0x6f, 0x6a, 0x40, 
-    0x72, 0x85, 0xd8, 0x34, 0x1d, 0x52, 0xc9, 0x7f, 
-    0x8d, 0xda, 0x87, 0x5b, 0x62, 0x22, 0x06, 0x72, 
-    0xde, 0xee, 0x7d, 0x1c, 0xf5, 0xaa, 0x86, 0x4d, 
-    0x25, 0x19, 0x0d, 0xd3, 0xc0, 0x62, 0x7e, 0x93, 
-    0xb6, 0x5d, 0x32, 0x28, 0x3d, 0xb7, 0x03, 0xb3, 
-    0x50, 0xaa, 0x11, 0xd2, 0x59, 0xeb, 0xff, 0x81, 
-    0x06, 0x5b, 0x10, 0xd4, 0x1b, 0xbb, 0x66, 0xcc, 
-    0x9d, 0xa5, 0x4a, 0x17, 0x71, 0x82, 0x25, 0x1c, 
-    0x69, 0x17, 0xf8, 0x67, 0xc3, 0x55, 0x85, 0x38, 
-    0x54, 0x96, 0x79, 0xb2, 0x14, 0xf5, 0x9a, 0x65, 
-    0x8b, 0x76, 0x4a, 0x32, 0x85, 0x5a, 0x02, 0x28, 
-    0x4e, 0x64, 0xe7, 0x26, 0x10, 0xf3, 0xc9, 0x8f, 
-    0x23, 0x2a, 0x54, 0x11, 0x54, 0xb5, 0x0c, 0x48, 
-    0x07, 0xbb, 0xba, 0x58, 0x2a, 0x0d, 0x17, 0x78, 
-    0x53, 0x3c, 0xdd, 0x22, 0x4c, 0x4f, 0x8f, 0x60, 
-    0xfa, 0x01, 0x69, 0x27, 0xcd, 0x24, 0x1a, 0x1f, 
-    0xcf, 0xd5, 0x1c, 0x4b, 0xe5, 0x9a, 0x87, 0x26, 
-    0x6b, 0xa9, 0xc8, 0x7c, 0x06, 0x8d, 0x87, 0x34, 
-    0x76, 0x3e, 0xad, 0xe7, 0x76, 0x20, 0x20, 0x52, 
-    0xfd, 0x4a, 0x4c, 0xdd, 0xf8, 0xff, 0x1a
-};
-static unsigned char xk1[] = {
-    0x8d, 0x0a, 0xe3, 0x0d, 0x28, 0x04, 0xa8, 0xd2, 
-    0x50, 0x95, 0x81, 0x0e, 0x50, 0x89, 0x81, 0xae, 
-    0xd4, 0x48, 0xe8, 0x8f, 0xbe, 0x99, 0x6c, 0xdb, 
-    0x8b, 0xea, 0xdd, 0xea, 0x39, 0xa5, 0xf4, 0x7a, 
-    0xe4, 0x88, 0x88, 0x5b, 0x8d, 0x07, 0xdb, 0xe3, 
-    0x90, 0x5c, 0xc9, 0xbd, 0xfa, 0xe4, 0x63, 0x65, 
-    0xfd, 0x67, 0x17, 0x8d, 0x95, 0xf6, 0xca, 0xc0, 
-    0x62, 0x21, 0xc3, 0xac, 0xd5, 0x83, 0xf3, 0x5c
-};
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup761test.c 20220801-1/crypto-tests/crypto_kem_sntrup761test.c
--- 20190101-1/crypto-tests/crypto_kem_sntrup761test.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup761test.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,77 @@
+/*
+20210316
+Jan Mojzis
+Public domain.
+*/
+
+#include "misc.h"
+#include "crypto_kem_sntrup761.h"
+#include "crypto_kem_sntrup761test.data"
+
+unsigned char sk[crypto_kem_sntrup761_SECRETKEYBYTES + 16];
+unsigned char pk[crypto_kem_sntrup761_PUBLICKEYBYTES + 16];
+unsigned char c[crypto_kem_sntrup761_CIPHERTEXTBYTES + 16];
+unsigned char k1[crypto_kem_sntrup761_BYTES + 16];
+unsigned char k2[crypto_kem_sntrup761_BYTES + 16];
+#define xk2 k2
+
+static void test_random(void) {
+
+    long long i, j;
+
+    for (i = 0; i < 16; ++i) {
+        if (crypto_kem_sntrup761_keypair(pk + i, sk + i) != 0) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761_SECRETKEYBYTES);
+            fail("crypto_kem_sntrup761_keypair() failure, please report it !!!!!!!!!");
+        }
+        if (crypto_kem_sntrup761_enc(c + i, k1 + i, pk + i) != 0) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761_SECRETKEYBYTES);
+            fail_printdata("c", c + i, crypto_kem_sntrup761_CIPHERTEXTBYTES);
+            fail_printdata("k1", k1 + i, crypto_kem_sntrup761_BYTES);
+            fail("crypto_kem_sntrup761_enc() failure, please report it !!!!!!!!!");
+        }
+        if (crypto_kem_sntrup761_dec(k2 + i, c + i, sk + i) != 0) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761_SECRETKEYBYTES);
+            fail_printdata("c", c + i, crypto_kem_sntrup761_CIPHERTEXTBYTES);
+            fail_printdata("k1", k1 + i, crypto_kem_sntrup761_BYTES);
+            fail_printdata("k2", k2 + i, crypto_kem_sntrup761_BYTES);
+            fail("crypto_kem_sntrup761_dec() failure, please report it !!!!!!!!!");
+        }
+        for (j = 0; j < crypto_kem_sntrup761_BYTES; ++j) if (k1[i + j] != k2[i + j]) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761_SECRETKEYBYTES);
+            fail_printdata("c", c + i, crypto_kem_sntrup761_CIPHERTEXTBYTES);
+            fail_printdata("k1", k1 + i, crypto_kem_sntrup761_BYTES);
+            fail_printdata("k2", k2 + i, crypto_kem_sntrup761_BYTES);
+            fail("crypto_kem_sntrup761_dec() failure, please report it !!!!!!!!!");
+        }
+    }
+}
+
+static void test_dec(void) {
+
+    long long j;
+
+    if (crypto_kem_sntrup761_dec(xk2, xc, xsk) != 0) {
+        fail_printdata("xk1", xk1, crypto_kem_sntrup761_BYTES);
+        fail_printdata("xk2", xk2, crypto_kem_sntrup761_BYTES);
+        fail("crypto_kem_sntrup761_dec() failure, please report it !!!!!!!!!");
+    }
+    for (j = 0; j < crypto_kem_sntrup761_BYTES; ++j) if (xk1[j] != xk2[j]) {
+        fail_printdata("xk1", xk1, crypto_kem_sntrup761_BYTES);
+        fail_printdata("xk2", xk2, crypto_kem_sntrup761_BYTES);
+        fail("crypto_kem_sntrup761_dec() failure, please report it !!!!!!!!!");
+    }
+}
+
+
+int main(void) {
+
+    test_dec();
+    test_random();
+
+    _exit(0);
+}
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup761test.data 20220801-1/crypto-tests/crypto_kem_sntrup761test.data
--- 20190101-1/crypto-tests/crypto_kem_sntrup761test.data	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup761test.data	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,363 @@
+static unsigned char xsk[] = {
+    0x65, 0x55, 0x15, 0x60, 0x2a, 0x51, 0x55, 0xa5, 
+    0x51, 0x45, 0x50, 0x54, 0x56, 0x65, 0x52, 0x22, 
+    0x45, 0xaa, 0x41, 0x55, 0x91, 0x55, 0x56, 0xa9, 
+    0x55, 0x44, 0x55, 0x16, 0x55, 0x8a, 0x95, 0x65, 
+    0x19, 0x00, 0x61, 0x98, 0x59, 0x95, 0x64, 0x55, 
+    0xa8, 0x65, 0x91, 0x55, 0x56, 0x95, 0x89, 0x11, 
+    0x55, 0x91, 0x49, 0x55, 0x4a, 0x46, 0x01, 0x46, 
+    0x49, 0x51, 0x11, 0x5a, 0x25, 0x51, 0x9a, 0x45, 
+    0x65, 0x52, 0x10, 0x19, 0x45, 0x11, 0x55, 0x45, 
+    0x61, 0x24, 0x86, 0x96, 0x54, 0x98, 0x90, 0x15, 
+    0x55, 0x64, 0x64, 0x99, 0x55, 0x44, 0x25, 0x51, 
+    0x65, 0x56, 0x54, 0x54, 0x54, 0x44, 0x41, 0xa5, 
+    0x56, 0x66, 0x16, 0x45, 0x60, 0x54, 0x55, 0x45, 
+    0x51, 0x66, 0x54, 0x54, 0x59, 0x94, 0x96, 0x19, 
+    0x55, 0x55, 0x25, 0x55, 0x66, 0x99, 0x15, 0x45, 
+    0x55, 0x55, 0x45, 0x52, 0x11, 0x5a, 0x94, 0x09, 
+    0x55, 0xa8, 0x56, 0x65, 0x54, 0x56, 0x49, 0x61, 
+    0x65, 0x15, 0x56, 0x15, 0x06, 0x51, 0x94, 0x45, 
+    0x45, 0x00, 0x65, 0x91, 0x66, 0x08, 0x54, 0x55, 
+    0x15, 0x95, 0x84, 0x41, 0x65, 0xa0, 0x45, 0x56, 
+    0x45, 0x55, 0x99, 0x14, 0x65, 0x50, 0x95, 0x56, 
+    0x51, 0x41, 0x55, 0x55, 0x54, 0x95, 0x55, 0x55, 
+    0x1a, 0x42, 0x58, 0x65, 0x59, 0x55, 0x51, 0x21, 
+    0x99, 0x55, 0x95, 0x55, 0x51, 0x55, 0x02, 0x41, 
+    0x62, 0x05, 0x95, 0x00, 0x66, 0x11, 0x56, 0x00, 
+    0x5a, 0x69, 0x84, 0x08, 0x86, 0x58, 0x1a, 0x18, 
+    0x89, 0x24, 0x28, 0x89, 0x24, 0x59, 0x80, 0x05, 
+    0x81, 0x62, 0x42, 0x44, 0x85, 0xa5, 0x50, 0x15, 
+    0x05, 0xa8, 0x22, 0x6a, 0x26, 0x15, 0x28, 0x5a, 
+    0x02, 0x46, 0x6a, 0x1a, 0x12, 0xa0, 0x6a, 0x49, 
+    0x52, 0x45, 0x86, 0x88, 0x58, 0x16, 0x61, 0x28, 
+    0x94, 0xa9, 0x12, 0x08, 0x09, 0x28, 0x1a, 0xa1, 
+    0x10, 0x40, 0x2a, 0x66, 0x96, 0x49, 0x0a, 0x96, 
+    0x08, 0x08, 0x41, 0x46, 0x95, 0x59, 0x8a, 0x69, 
+    0x45, 0x04, 0x26, 0xa9, 0x14, 0xa9, 0x59, 0x52, 
+    0x81, 0x21, 0x26, 0x42, 0x51, 0x69, 0x16, 0x65, 
+    0x65, 0x20, 0x26, 0x56, 0x11, 0x11, 0x2a, 0x61, 
+    0x04, 0x00, 0x89, 0x42, 0x26, 0x88, 0x56, 0xa4, 
+    0x91, 0x98, 0x89, 0x65, 0x29, 0x86, 0x0a, 0x84, 
+    0x59, 0x61, 0xa6, 0x55, 0x46, 0x1a, 0x29, 0x05, 
+    0xa4, 0x15, 0x82, 0x65, 0x96, 0x98, 0xa8, 0x18, 
+    0x8a, 0x80, 0x08, 0x50, 0x64, 0x10, 0x95, 0x49, 
+    0xa4, 0x6a, 0x60, 0x85, 0x82, 0x68, 0x25, 0x18, 
+    0x09, 0x00, 0xa1, 0x06, 0x10, 0x28, 0x54, 0x81, 
+    0xa9, 0x15, 0x18, 0x40, 0x29, 0x10, 0x01, 0x42, 
+    0x22, 0x6a, 0x95, 0x52, 0xa2, 0x26, 0x11, 0x29, 
+    0x55, 0x49, 0x14, 0x55, 0x68, 0x65, 0x66, 0x48, 
+    0xa5, 0x54, 0x85, 0x28, 0xa0, 0x02, 0x95, 0x0c, 
+    0x33, 0x82, 0xe7, 0x2e, 0xf8, 0xd9, 0x31, 0xf1, 
+    0xca, 0xba, 0x92, 0x92, 0x31, 0xff, 0x3a, 0xb8, 
+    0xa8, 0xc0, 0x73, 0x00, 0x14, 0x94, 0x2a, 0xdd, 
+    0x41, 0xf5, 0x94, 0xfc, 0xdc, 0x5a, 0x4a, 0xc1, 
+    0x77, 0x42, 0xf2, 0xd4, 0x40, 0x00, 0x07, 0x2d, 
+    0xe0, 0x07, 0xd1, 0x7c, 0xab, 0x0e, 0xda, 0x08, 
+    0xb6, 0xe9, 0x53, 0x0c, 0xf7, 0xad, 0x09, 0xb2, 
+    0x84, 0xe2, 0x26, 0x05, 0x06, 0x84, 0x3e, 0xd6, 
+    0x86, 0xc6, 0xf5, 0x8c, 0xce, 0x5a, 0x0b, 0x57, 
+    0x4a, 0xcc, 0xf4, 0xbc, 0xa7, 0x8b, 0x4f, 0x41, 
+    0x22, 0xb2, 0x67, 0xfb, 0x1e, 0xf5, 0x64, 0x65, 
+    0x54, 0x69, 0x1a, 0x16, 0x8c, 0x9b, 0x21, 0xb6, 
+    0x11, 0xf5, 0x56, 0x90, 0xdd, 0xa3, 0xa8, 0x0e, 
+    0x93, 0x5a, 0x50, 0x2b, 0x06, 0x36, 0x51, 0xd8, 
+    0xf2, 0x41, 0x4d, 0x6e, 0x47, 0xeb, 0xe4, 0xec, 
+    0xb4, 0xf7, 0x36, 0x3b, 0x55, 0x11, 0x70, 0x86, 
+    0xe7, 0x3a, 0x45, 0xb3, 0xfb, 0x0a, 0x82, 0xb8, 
+    0xed, 0xda, 0x24, 0x47, 0x3e, 0x85, 0xe2, 0x37, 
+    0xbb, 0x35, 0xaa, 0xd6, 0x34, 0xd4, 0xbe, 0xed, 
+    0x08, 0x45, 0xae, 0x22, 0xde, 0x6a, 0x79, 0x0f, 
+    0x36, 0xff, 0xb0, 0x14, 0x99, 0xa3, 0xe9, 0x1a, 
+    0x01, 0x68, 0xb6, 0x5f, 0xed, 0x65, 0xc5, 0x73, 
+    0xa7, 0x94, 0x6b, 0xff, 0x57, 0xa0, 0x65, 0x3a, 
+    0x17, 0x7a, 0x8d, 0x98, 0x0e, 0x69, 0xe0, 0x91, 
+    0x4a, 0x7d, 0xff, 0x92, 0xc9, 0xce, 0x25, 0xec, 
+    0xd6, 0x11, 0xd2, 0x12, 0x3f, 0x51, 0x9a, 0xaa, 
+    0x92, 0xb2, 0xb5, 0x1d, 0x97, 0x84, 0xbd, 0x48, 
+    0x09, 0xaa, 0x2d, 0x51, 0x3f, 0x26, 0x7a, 0x6b, 
+    0xa7, 0x4d, 0xa6, 0x81, 0x3b, 0x14, 0xd3, 0xbe, 
+    0xb6, 0xa2, 0x6f, 0x62, 0xa1, 0x9a, 0xc6, 0x87, 
+    0x59, 0x17, 0x81, 0x20, 0x24, 0xb3, 0x6f, 0xa3, 
+    0x53, 0xb1, 0x23, 0x8d, 0x4c, 0x9a, 0x06, 0xba, 
+    0xb9, 0x36, 0x67, 0xc6, 0x8e, 0x8a, 0x0b, 0xa9, 
+    0x51, 0x0c, 0x20, 0x01, 0x2f, 0xff, 0xa3, 0xa0, 
+    0xc1, 0xeb, 0xa5, 0x64, 0xb6, 0x19, 0x3a, 0x50, 
+    0xe9, 0xfc, 0x19, 0x9e, 0x99, 0x61, 0xc8, 0xc3, 
+    0x71, 0x12, 0xcc, 0x4a, 0xa8, 0x00, 0x79, 0xc1, 
+    0x5d, 0x8b, 0xc1, 0x3e, 0x66, 0xae, 0x6e, 0xaa, 
+    0xe5, 0x1d, 0xaf, 0x9b, 0xa4, 0xee, 0x4d, 0x00, 
+    0x50, 0x0f, 0x4f, 0x46, 0xe0, 0x6e, 0xf3, 0x14, 
+    0x06, 0x6d, 0x76, 0xab, 0xd1, 0xe1, 0xb9, 0xa2, 
+    0xcc, 0x64, 0x65, 0x9c, 0xbe, 0xe6, 0x89, 0x48, 
+    0xcd, 0x62, 0x2e, 0xfc, 0x98, 0xe3, 0xb6, 0x12, 
+    0xe1, 0x94, 0x91, 0x2c, 0x01, 0x6a, 0xbc, 0xc4, 
+    0xa7, 0xc7, 0x8a, 0xe6, 0x5a, 0xd4, 0x62, 0x3e, 
+    0x01, 0x82, 0x8f, 0xc3, 0x17, 0xd2, 0xbd, 0x28, 
+    0xfd, 0xc3, 0x08, 0x67, 0xfc, 0xfd, 0x68, 0xd8, 
+    0xb9, 0x80, 0x9f, 0x6a, 0xa5, 0xfd, 0xe6, 0x21, 
+    0x93, 0x8b, 0x52, 0xe1, 0xa2, 0x2a, 0x4f, 0x96, 
+    0xce, 0xb0, 0xcf, 0xb3, 0xba, 0xcf, 0x02, 0x25, 
+    0xe1, 0xfd, 0xf1, 0x3c, 0x4f, 0x9b, 0x03, 0xd8, 
+    0xa5, 0xcb, 0x58, 0x9c, 0xe9, 0xed, 0xbe, 0x7b, 
+    0x76, 0xa9, 0xfc, 0xfe, 0xc4, 0x7d, 0xa9, 0x2e, 
+    0x38, 0x92, 0x7b, 0xd0, 0x5f, 0xfb, 0x83, 0x62, 
+    0x37, 0xf2, 0x00, 0x04, 0xe4, 0x53, 0x5a, 0x7b, 
+    0x5e, 0x78, 0x6b, 0x13, 0x11, 0xce, 0x39, 0x76, 
+    0x90, 0xd8, 0x78, 0x8b, 0x6f, 0xd0, 0xb4, 0x3b, 
+    0xad, 0x79, 0x25, 0xa4, 0x5e, 0x94, 0xe5, 0xb2, 
+    0x26, 0xad, 0xf1, 0x4e, 0x33, 0x06, 0xcb, 0x52, 
+    0xf1, 0x76, 0xf4, 0x61, 0x68, 0xa4, 0xb7, 0xbc, 
+    0xda, 0xc8, 0xc3, 0x90, 0x33, 0x06, 0x5c, 0x18, 
+    0xb8, 0x16, 0x88, 0x36, 0x4d, 0x54, 0xa1, 0x77, 
+    0xf5, 0xb4, 0x32, 0xba, 0xbc, 0x9c, 0xd7, 0x16, 
+    0x98, 0xde, 0x76, 0x9c, 0x54, 0x8d, 0x0b, 0xfb, 
+    0x72, 0xf9, 0xff, 0x3b, 0xb2, 0x2a, 0x5d, 0x8b, 
+    0x6f, 0x40, 0x8b, 0x16, 0x20, 0x8a, 0x35, 0x45, 
+    0x8f, 0x19, 0x3b, 0x81, 0x2f, 0x2c, 0x97, 0xc5, 
+    0xc1, 0x5e, 0xbe, 0xdf, 0x47, 0x0e, 0x65, 0xd6, 
+    0x9b, 0x7d, 0x28, 0x58, 0xa8, 0x6b, 0xb3, 0xfc, 
+    0x11, 0x7f, 0x52, 0x0e, 0x21, 0x77, 0x4c, 0x35, 
+    0x89, 0xf9, 0xd4, 0x18, 0xc8, 0xfc, 0x45, 0xe5, 
+    0x57, 0x15, 0x1c, 0x36, 0x50, 0x0c, 0x77, 0xcc, 
+    0xe0, 0x4c, 0xc5, 0xf0, 0x1f, 0x7f, 0xfd, 0x9a, 
+    0x57, 0xa7, 0x22, 0x22, 0xd1, 0x9a, 0x7c, 0xdb, 
+    0x40, 0x27, 0xd5, 0x75, 0xf1, 0x0e, 0x27, 0x0f, 
+    0xbf, 0xaa, 0x24, 0x63, 0x19, 0x70, 0x64, 0x77, 
+    0xe4, 0x6c, 0x32, 0x71, 0x66, 0x14, 0xe3, 0xa5, 
+    0xb4, 0xac, 0xe5, 0xe9, 0xbd, 0x8b, 0xfb, 0x83, 
+    0x7d, 0xd2, 0x9a, 0x5d, 0xe7, 0x5f, 0xac, 0xe7, 
+    0xf6, 0xb7, 0xd3, 0xc4, 0xf6, 0x78, 0x1f, 0x54, 
+    0x25, 0x1e, 0x0c, 0xa7, 0x6c, 0x4b, 0xab, 0x44, 
+    0xf2, 0x1f, 0x30, 0x0c, 0x4a, 0x3e, 0x0d, 0x2c, 
+    0x15, 0xd8, 0xed, 0xee, 0x20, 0xdd, 0xbc, 0x24, 
+    0xb9, 0x2d, 0x27, 0xcc, 0x8a, 0x11, 0x19, 0xc4, 
+    0xfb, 0x2f, 0xcf, 0xe3, 0x69, 0x3c, 0x60, 0x4f, 
+    0xa3, 0x7a, 0x3b, 0x58, 0x47, 0x04, 0xdb, 0x94, 
+    0x02, 0x07, 0x5a, 0x11, 0x70, 0xd1, 0xa1, 0xd4, 
+    0x0e, 0xe5, 0x45, 0x34, 0xdf, 0x73, 0xd6, 0x6b, 
+    0xed, 0xdc, 0xb2, 0x07, 0xde, 0x7a, 0x57, 0xdd, 
+    0x44, 0x4e, 0x08, 0x4b, 0x43, 0xa8, 0xfa, 0x2d, 
+    0x24, 0x6b, 0x58, 0x0d, 0x2a, 0xb6, 0x4b, 0x15, 
+    0x79, 0x21, 0x40, 0xcb, 0xb8, 0x82, 0xf6, 0x96, 
+    0x19, 0x76, 0x07, 0xfd, 0x42, 0xe6, 0x43, 0xd2, 
+    0x0c, 0xfa, 0xc1, 0x07, 0xf7, 0xc3, 0x1b, 0xaf, 
+    0x27, 0xe4, 0x63, 0x84, 0x92, 0x42, 0x95, 0x16, 
+    0x52, 0xbb, 0x77, 0x5d, 0x6a, 0x2c, 0x1e, 0x01, 
+    0x53, 0x85, 0xa4, 0x06, 0xd6, 0xdf, 0x3f, 0xaa, 
+    0x5b, 0xfc, 0x46, 0x9e, 0x3e, 0x3d, 0x5b, 0xe6, 
+    0x9d, 0x5b, 0x61, 0x8b, 0x6b, 0xd9, 0x8e, 0x2c, 
+    0x09, 0x48, 0xe5, 0x76, 0x9e, 0xe2, 0x88, 0x0c, 
+    0xed, 0xed, 0x8c, 0xda, 0x59, 0x31, 0xe8, 0xf3, 
+    0x1d, 0x9e, 0xea, 0xe1, 0x11, 0xa8, 0xc3, 0xac, 
+    0xb3, 0xff, 0x22, 0xf9, 0x97, 0xdd, 0x4b, 0x1f, 
+    0x85, 0xa4, 0xdf, 0xe8, 0x61, 0x3b, 0x97, 0x53, 
+    0x9e, 0x2f, 0x48, 0xa9, 0xdb, 0xbf, 0x85, 0x84, 
+    0x8d, 0x9a, 0x8a, 0x89, 0x35, 0xf8, 0xa7, 0x33, 
+    0x10, 0x61, 0xd4, 0x76, 0xd3, 0xaf, 0x1b, 0xbe, 
+    0xca, 0x77, 0x91, 0xa9, 0x1a, 0x89, 0xae, 0xeb, 
+    0x96, 0x23, 0xe1, 0x12, 0x5c, 0x5f, 0x57, 0xcc, 
+    0x7d, 0x8f, 0x26, 0x9d, 0x3d, 0x1b, 0x96, 0x86, 
+    0xc0, 0x22, 0x3d, 0x77, 0x3b, 0xff, 0x5c, 0x16, 
+    0x60, 0x47, 0x35, 0x35, 0xe7, 0xb9, 0xe0, 0xb0, 
+    0xf1, 0x7e, 0x63, 0x65, 0x0c, 0x17, 0xcf, 0x92, 
+    0x3d, 0x40, 0x94, 0xe3, 0xcd, 0xf1, 0xf0, 0x39, 
+    0xd7, 0x57, 0x2c, 0x09, 0x62, 0x39, 0x2f, 0xc9, 
+    0x39, 0xc4, 0x98, 0x81, 0x08, 0x9a, 0x5e, 0xfd, 
+    0xbe, 0xb0, 0xd7, 0xb3, 0x5d, 0x0c, 0x81, 0x22, 
+    0x96, 0x3d, 0xaa, 0x1b, 0xe2, 0x30, 0x13, 0x7c, 
+    0xc9, 0x4d, 0xf4, 0x4b, 0xeb, 0xcc, 0xd3, 0xc6, 
+    0x50, 0x1b, 0x20, 0x02, 0xd0, 0x0c, 0x65, 0xb1, 
+    0x02, 0x83, 0xf3, 0xf4, 0x85, 0x0f, 0xc5, 0x79, 
+    0xdc, 0x3f, 0x66, 0xd5, 0xb0, 0x06, 0x57, 0x0a, 
+    0x72, 0x85, 0xbe, 0xaf, 0x12, 0x76, 0x44, 0xf4, 
+    0xb8, 0x76, 0x1c, 0xfa, 0x6e, 0x74, 0x9b, 0xa7, 
+    0x8b, 0x30, 0xca, 0xc6, 0x90, 0x3f, 0xbf, 0xd0, 
+    0x23, 0x3b, 0x75, 0x95, 0x2f, 0x06, 0xb5, 0xea, 
+    0x5b, 0xa0, 0x49, 0x31, 0x13, 0x55, 0xb8, 0xe3, 
+    0xfa, 0x3b, 0x52, 0xdb, 0xe3, 0x06, 0x49, 0x23, 
+    0xd2, 0x7c, 0xfb, 0x09, 0x23, 0xae, 0x51, 0xdc, 
+    0x92, 0x06, 0x75, 0x69, 0x62, 0x9c, 0xaa, 0x02, 
+    0xd9, 0xf0, 0xa5, 0x5b, 0xb5, 0x18, 0xee, 0x01, 
+    0xce, 0xa2, 0x53, 0x55, 0x35, 0x89, 0xcf, 0x23, 
+    0xf9, 0x1f, 0xad, 0x0c, 0xac, 0x3c, 0x49, 0x17, 
+    0xa5, 0xea, 0x06, 0x7f, 0xc5, 0x0d, 0x2c, 0x25, 
+    0x1a, 0x62, 0xf4, 0x3d, 0x6a, 0x5f, 0xfa, 0xb3, 
+    0xfb, 0xc4, 0x7f, 0xa1, 0x00, 0x94, 0x2e, 0xb2, 
+    0xff, 0x10, 0x16, 0x2d, 0xad, 0xa8, 0x4b, 0x3a, 
+    0x06, 0x12, 0x5d, 0x53, 0xe8, 0xc1, 0xcd, 0xcf, 
+    0x7b, 0x8c, 0x46, 0x4d, 0xad, 0xb5, 0x38, 0xa4, 
+    0x76, 0xb7, 0x9c, 0x8c, 0x3a, 0x9e, 0x13, 0x98, 
+    0xd1, 0xb4, 0xe1, 0x45, 0xfe, 0xdd, 0x88, 0x6f, 
+    0x8b, 0xca, 0x22, 0x07, 0xa2, 0xb2, 0xc5, 0x51, 
+    0x5e, 0x45, 0x33, 0x43, 0xd9, 0x17, 0x74, 0x1a, 
+    0x6e, 0x3e, 0x48, 0x87, 0x6a, 0x09, 0x01, 0xa6, 
+    0x50, 0xac, 0xf9, 0x04, 0x6c, 0x5f, 0x7a, 0xa0, 
+    0x90, 0xd7, 0x33, 0x14, 0xc2, 0x7c, 0x84, 0xe6, 
+    0x9b, 0xfd, 0x8f, 0x03, 0x85, 0x0e, 0xaa, 0x17, 
+    0x05, 0xb1, 0x5f, 0x08, 0xe8, 0x78, 0xee, 0xfc, 
+    0xa0, 0x34, 0x4f, 0x80, 0x3d, 0xb6, 0xb4, 0x8e, 
+    0x17, 0x5e, 0x55, 0xca, 0x16, 0x44, 0xa8, 0xd2, 
+    0xa2, 0x87, 0xc3, 0x2f, 0x00, 0xc6, 0xd9, 0x9b, 
+    0xbe, 0xc3, 0x98, 0x9b, 0xe8, 0x2c, 0xe7, 0xaf, 
+    0x01, 0xea, 0x8a, 0xc2, 0x2d, 0x36, 0x9f, 0xce, 
+    0x23, 0x83, 0xea, 0x39, 0x76, 0xbe, 0x77, 0x52, 
+    0xdd, 0x8b, 0x65, 0x75, 0x71, 0xc2, 0x14, 0xa0, 
+    0xa2, 0x6a, 0x83, 0x7f, 0xf8, 0x82, 0x06, 0xd9, 
+    0xfb, 0x51, 0xc5, 0xce, 0x4d, 0x3d, 0x75, 0xf0, 
+    0x17, 0xaa, 0xcf, 0xf4, 0xb2, 0x59, 0xc4, 0x72, 
+    0x2a, 0x31, 0x1e, 0x5d, 0x33, 0xc9, 0x90, 0x8b, 
+    0x07, 0x27, 0x97, 0x53, 0x3a, 0xc7, 0x44, 0x25, 
+    0xa1, 0x73, 0x46, 0x6c, 0x00, 0xdb, 0x8b, 0xc8, 
+    0x94, 0x9e, 0x2a, 0x11, 0xb5, 0xb4, 0x38, 0x88, 
+    0x74, 0xac, 0x8f, 0xc3, 0xf1, 0x1d, 0x88, 0xdc, 
+    0xfd, 0xc7, 0xef, 0x07, 0xbe, 0x4b, 0xe3, 0xdd, 
+    0x9f, 0x02, 0xcb, 0x6e, 0xbc, 0x26, 0xa4, 0x8c, 
+    0x01, 0xb2, 0xba, 0xbf, 0xf1, 0x6b, 0x7f, 0x87, 
+    0xa2, 0xc5, 0xca, 0xbd, 0x31, 0xa5, 0xe5, 0x24, 
+    0xa0, 0xa2, 0x84, 0x23, 0x9c, 0x06, 0xe7, 0x48, 
+    0x04, 0xad, 0xdd, 0xaf, 0xe6, 0x90, 0x27, 0x13, 
+    0xeb, 0xef, 0xcc, 0x24, 0x5a, 0x57, 0xc2, 0x7b, 
+    0xaf, 0xdf, 0x70, 0xf1, 0x64, 0x1e, 0xc2, 0x31, 
+    0xf9, 0xab, 0xd1, 0x8d, 0x02, 0xed, 0x8f, 0xbf, 
+    0xda, 0x13, 0x29
+};
+
+static unsigned char xc[] = {
+    0x9d, 0x9c, 0x62, 0x7b, 0xe2, 0x3a, 0x22, 0x4a, 
+    0xb1, 0x12, 0x76, 0x21, 0x4c, 0xca, 0x8c, 0x3f, 
+    0xea, 0x2a, 0x78, 0x20, 0x2c, 0x0d, 0x51, 0x94, 
+    0x40, 0x2d, 0x6e, 0x6c, 0xad, 0xb5, 0x29, 0x95, 
+    0x4c, 0xe5, 0x1e, 0xeb, 0x28, 0xe1, 0xfa, 0xd4, 
+    0x42, 0xc6, 0xc3, 0xd6, 0x03, 0xb1, 0xaa, 0x8f, 
+    0xe5, 0x87, 0x56, 0x69, 0xd9, 0x58, 0x7a, 0xcb, 
+    0xd2, 0xea, 0x80, 0xe8, 0xc9, 0x78, 0x15, 0xe0, 
+    0x0b, 0xb4, 0x4b, 0x1c, 0xc4, 0x3d, 0x2d, 0x7b, 
+    0xc5, 0x36, 0x0e, 0x8a, 0x82, 0xe0, 0x8a, 0xbf, 
+    0xd3, 0x10, 0x4c, 0x01, 0x15, 0x47, 0x05, 0xfc, 
+    0x26, 0x86, 0x8a, 0xd8, 0x20, 0x81, 0xd5, 0x35, 
+    0x59, 0xd0, 0x74, 0xdf, 0xcd, 0x0e, 0xb9, 0x4d, 
+    0x80, 0x4b, 0x8d, 0xfd, 0xbd, 0x80, 0xa0, 0x20, 
+    0xbd, 0x2a, 0x58, 0xf2, 0xd0, 0x08, 0xb8, 0x7d, 
+    0x8e, 0xd9, 0xff, 0x36, 0xb3, 0x1d, 0xe7, 0x94, 
+    0x87, 0x5c, 0x5f, 0xf7, 0x49, 0x48, 0x41, 0x95, 
+    0x67, 0x68, 0x3e, 0x6c, 0xcd, 0x36, 0x15, 0xdf, 
+    0x47, 0xad, 0x14, 0x66, 0x61, 0x99, 0x8b, 0x3f, 
+    0x10, 0x3e, 0x7e, 0xe9, 0xbb, 0x60, 0xed, 0x87, 
+    0x7b, 0x90, 0x23, 0xc1, 0x5a, 0x80, 0xbd, 0x7f, 
+    0x67, 0x0e, 0x4a, 0xa2, 0x7e, 0xb4, 0x6d, 0xcc, 
+    0x67, 0x3d, 0x91, 0xe8, 0xf7, 0xd9, 0x25, 0x38, 
+    0x54, 0xcf, 0xb1, 0x8a, 0x15, 0xdd, 0xc3, 0x94, 
+    0xaf, 0x6d, 0x04, 0xf9, 0x35, 0x56, 0xe7, 0x8a, 
+    0xbc, 0x16, 0xce, 0x33, 0xf8, 0x7e, 0xdd, 0x84, 
+    0x67, 0x28, 0xca, 0x09, 0x75, 0xcb, 0x86, 0x03, 
+    0x08, 0x96, 0xf9, 0xee, 0xc3, 0x9b, 0x3d, 0x18, 
+    0xb8, 0x77, 0x28, 0x64, 0x69, 0xd4, 0x53, 0x63, 
+    0xbd, 0x55, 0x59, 0xc7, 0x0c, 0x78, 0xda, 0x65, 
+    0xd6, 0xb9, 0xe4, 0x0e, 0xb5, 0xc5, 0xcd, 0x95, 
+    0xec, 0x5c, 0x03, 0x1b, 0xf2, 0x7a, 0xd8, 0xde, 
+    0x16, 0x62, 0x1d, 0x8d, 0x3f, 0xb3, 0xa1, 0xf4, 
+    0x46, 0x72, 0xd5, 0x93, 0x3c, 0xc9, 0x86, 0xf2, 
+    0x58, 0x1e, 0x10, 0x62, 0x39, 0xc5, 0x8d, 0xd8, 
+    0xda, 0x88, 0xa1, 0x6b, 0xee, 0x76, 0xad, 0xda, 
+    0xa0, 0x21, 0x90, 0x10, 0x6e, 0x25, 0x31, 0x59, 
+    0xeb, 0xcd, 0xb8, 0x26, 0x34, 0x38, 0x4c, 0xab, 
+    0x3e, 0x9d, 0x00, 0xcd, 0x4b, 0x4e, 0xcd, 0x0e, 
+    0x6e, 0x33, 0x7f, 0x61, 0x5c, 0x62, 0x77, 0xba, 
+    0x6c, 0xc1, 0xd3, 0xe3, 0x35, 0xf2, 0xea, 0xaa, 
+    0x40, 0x11, 0x0a, 0xd1, 0x0f, 0x03, 0x36, 0xf1, 
+    0x06, 0xc5, 0x0a, 0x87, 0xe1, 0xf4, 0xe9, 0xc6, 
+    0x48, 0xb8, 0xe0, 0x26, 0xc4, 0x68, 0xd0, 0x7a, 
+    0x84, 0x8b, 0x44, 0x01, 0x18, 0x8c, 0xb5, 0x84, 
+    0x9d, 0xe2, 0x1a, 0xdc, 0x1a, 0x7f, 0xb0, 0x03, 
+    0x6b, 0xa1, 0xa1, 0xf3, 0xa9, 0xcd, 0x37, 0x9a, 
+    0x43, 0xab, 0x9e, 0xc3, 0xd5, 0x8a, 0x43, 0x6f, 
+    0xa3, 0x2f, 0x0f, 0x08, 0x19, 0xc5, 0xfb, 0x69, 
+    0x94, 0x78, 0x74, 0x01, 0x03, 0xd1, 0x2f, 0x04, 
+    0x2b, 0x6a, 0x5b, 0xed, 0x43, 0x26, 0xe0, 0x2a, 
+    0x90, 0xd5, 0xee, 0x85, 0x03, 0xe4, 0x3a, 0x8b, 
+    0xb3, 0xb1, 0xa4, 0x09, 0xc8, 0x4d, 0x20, 0xd7, 
+    0x87, 0x41, 0xa3, 0xbd, 0xca, 0x59, 0x21, 0xbf, 
+    0x0c, 0xde, 0xb3, 0xc0, 0xea, 0x88, 0x01, 0x28, 
+    0x37, 0x97, 0xd3, 0xf7, 0x2d, 0x49, 0x6c, 0xd6, 
+    0xc0, 0x78, 0x47, 0x92, 0x2c, 0xaf, 0xfe, 0x78, 
+    0xc2, 0x18, 0x0e, 0x5b, 0xd2, 0x27, 0x72, 0x54, 
+    0x31, 0x0f, 0x88, 0xb0, 0xa9, 0x5b, 0x6f, 0x5f, 
+    0x02, 0xe2, 0x44, 0xa1, 0xdb, 0x7c, 0x1b, 0xe0, 
+    0xcb, 0x0d, 0x56, 0x6b, 0xc2, 0x80, 0x84, 0x5d, 
+    0x28, 0x0c, 0x88, 0x3a, 0x4d, 0x98, 0x78, 0x55, 
+    0xd6, 0xe6, 0x34, 0x25, 0xc0, 0x75, 0x38, 0xf1, 
+    0xa7, 0x66, 0x2d, 0x2c, 0x10, 0x55, 0xf0, 0xb4, 
+    0xcf, 0x89, 0x4f, 0xba, 0x63, 0x94, 0x8a, 0xfd, 
+    0x1d, 0x12, 0x4d, 0xb7, 0xb5, 0x91, 0x69, 0x28, 
+    0x38, 0x76, 0x85, 0x23, 0xc4, 0xc3, 0xcd, 0x6c, 
+    0xa8, 0x89, 0x01, 0x85, 0xd0, 0xd9, 0xb3, 0xc3, 
+    0xdc, 0xea, 0x76, 0x8f, 0x30, 0x82, 0x88, 0xa9, 
+    0x3a, 0x83, 0x12, 0x25, 0x05, 0x4b, 0x62, 0x4a, 
+    0x7a, 0xdc, 0x3d, 0x12, 0x48, 0x3c, 0xb2, 0xc0, 
+    0x22, 0x11, 0x01, 0x08, 0xfd, 0x30, 0x91, 0x86, 
+    0x45, 0xb9, 0x42, 0x6a, 0xcb, 0x53, 0x18, 0xfd, 
+    0x4c, 0x76, 0x49, 0x4f, 0xe2, 0xca, 0xe2, 0x03, 
+    0x8e, 0xdb, 0xd4, 0x1f, 0xe8, 0x38, 0x2b, 0xf2, 
+    0x4a, 0xeb, 0xa0, 0x23, 0x73, 0xe4, 0xc0, 0x3f, 
+    0x6f, 0x6f, 0x35, 0x50, 0x24, 0xe8, 0x17, 0xf7, 
+    0xef, 0xa6, 0x1b, 0xd4, 0x62, 0xfc, 0xbf, 0x49, 
+    0x66, 0x21, 0x84, 0xae, 0xc1, 0xc4, 0x57, 0xdd, 
+    0xeb, 0x25, 0x1e, 0xd7, 0xca, 0xdf, 0x87, 0xb7, 
+    0xb4, 0xc6, 0x08, 0x93, 0x10, 0x15, 0x34, 0xf4, 
+    0xb9, 0xcf, 0x08, 0xa5, 0x7d, 0x8a, 0x68, 0x0c, 
+    0x4f, 0xc0, 0x01, 0xb7, 0x9c, 0x05, 0xe7, 0x7c, 
+    0x21, 0x26, 0xd0, 0x5e, 0xaa, 0xb9, 0xa3, 0x4f, 
+    0x2f, 0x34, 0x68, 0x01, 0xd2, 0x36, 0xbe, 0x99, 
+    0xca, 0xe6, 0x3c, 0xfb, 0x30, 0xea, 0xc2, 0x6c, 
+    0xd5, 0x2a, 0xa8, 0x41, 0x65, 0x82, 0x0b, 0x57, 
+    0x09, 0x7b, 0x8d, 0x46, 0x2e, 0xbf, 0x14, 0x22, 
+    0x70, 0x73, 0x15, 0x2e, 0xc6, 0xd6, 0x1c, 0xee, 
+    0x68, 0xae, 0x2f, 0xe3, 0x62, 0x2d, 0x3e, 0x02, 
+    0xb5, 0xe3, 0x03, 0xab, 0x5a, 0xc7, 0xd2, 0x81, 
+    0x3c, 0x42, 0x36, 0xdf, 0x77, 0x6f, 0x91, 0x13, 
+    0x72, 0xe3, 0x17, 0xa2, 0x69, 0xa7, 0x16, 0x7e, 
+    0x68, 0xb5, 0x22, 0x7d, 0xec, 0x5b, 0x6c, 0x5b, 
+    0x78, 0x6d, 0x36, 0x8e, 0x46, 0x41, 0xb5, 0xe1, 
+    0x39, 0x6f, 0xf3, 0xfe, 0xf1, 0xc9, 0x8d, 0x62, 
+    0xab, 0xc9, 0xcf, 0x7b, 0xce, 0xf2, 0x54, 0x52, 
+    0x98, 0x9f, 0x23, 0x87, 0xc5, 0x49, 0x25, 0x7e, 
+    0x3b, 0x42, 0x2b, 0x94, 0x10, 0xd9, 0x19, 0x78, 
+    0xd9, 0xaa, 0xcd, 0xb0, 0x86, 0x61, 0x04, 0xee, 
+    0x3e, 0xef, 0xca, 0x63, 0x07, 0x78, 0xb7, 0x90, 
+    0xf3, 0x20, 0x38, 0x37, 0x0d, 0x51, 0x9a, 0x54, 
+    0x24, 0xa2, 0x85, 0x1e, 0x21, 0xb0, 0xc3, 0x37, 
+    0x11, 0x78, 0x60, 0x75, 0x02, 0x96, 0xab, 0xbf, 
+    0x20, 0x40, 0xc3, 0xcf, 0x76, 0x69, 0x5d, 0x35, 
+    0x40, 0x13, 0xb1, 0xf0, 0x2b, 0xed, 0x7a, 0x1f, 
+    0xef, 0xa3, 0x20, 0x8f, 0x8a, 0x6d, 0x4a, 0x6d, 
+    0xd8, 0xff, 0x6f, 0xca, 0xb2, 0x03, 0x3f, 0xa9, 
+    0x00, 0x58, 0x6a, 0x44, 0x4c, 0x90, 0xb8, 0x13, 
+    0x04, 0x51, 0xfa, 0xfc, 0x9d, 0x06, 0x92, 0xfa, 
+    0x57, 0xf7, 0x3e, 0x03, 0x5e, 0xe9, 0xbe, 0xef, 
+    0xbd, 0x24, 0x31, 0xf9, 0x25, 0xf6, 0x9d, 0xb6, 
+    0x4e, 0x23, 0x70, 0xf9, 0x50, 0x29, 0xdc, 0x09, 
+    0xa7, 0xfa, 0xe9, 0xcb, 0xfe, 0x4c, 0x7e, 0xc5, 
+    0x98, 0xc5, 0xd0, 0x6c, 0xe7, 0x1a, 0x47, 0xc5, 
+    0x44, 0xe2, 0x4f, 0x1a, 0x76, 0xa1, 0xa4, 0xb9, 
+    0x13, 0x9b, 0x80, 0xd0, 0x66, 0xcb, 0x8e, 0x75, 
+    0x4f, 0x2b, 0x73, 0x9c, 0x81, 0x4d, 0xde, 0x0f, 
+    0x37, 0x06, 0x11, 0x1d, 0x42, 0x20, 0x07, 0x5d, 
+    0x0a, 0x3a, 0xb6, 0x4c, 0xeb, 0x7b, 0x7a, 0xf9, 
+    0x6e, 0x53, 0xbe, 0xe7, 0xd3, 0xc7, 0x46, 0x11, 
+    0x14, 0xff, 0x84, 0xc9, 0x11, 0xf5, 0xec, 0xb6, 
+    0x9e, 0x42, 0x94, 0xae, 0x8c, 0xfd, 0xb4, 0x69, 
+    0xf7, 0x38, 0xfe, 0x5d, 0xad, 0xd6, 0x9f, 0xe4, 
+    0xd6, 0x83, 0xe4, 0x3d, 0x90, 0xaa, 0xad, 0x07, 
+    0x65, 0xd7, 0x2b, 0x4e, 0x11, 0xca, 0x02, 0x21, 
+    0x3b, 0x1e, 0x80, 0xc2, 0x78, 0x9c, 0x57, 0xaa, 
+    0x8f, 0xdb, 0xc7, 0xd8, 0xae, 0x31, 0x5c, 0xbf, 
+    0xe8, 0xd7, 0x40, 0x78, 0x24, 0x59, 0xfe, 0x8b, 
+    0x1e, 0x12, 0x31, 0x90, 0x4a, 0xf5, 0x68
+};
+
+static unsigned char xk1[] = {
+    0xed, 0xa0, 0xcc, 0xf8, 0x26, 0x0c, 0xf4, 0x95, 
+    0x5d, 0xa7, 0x71, 0xa3, 0x90, 0xed, 0xf0, 0xd9, 
+    0x87, 0xf7, 0xfc, 0xec, 0x54, 0xf2, 0xbe, 0xd7, 
+    0x91, 0x79, 0xc7, 0xec, 0x2d, 0xd2, 0x1d, 0x05
+};
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup761x25519test.c 20220801-1/crypto-tests/crypto_kem_sntrup761x25519test.c
--- 20190101-1/crypto-tests/crypto_kem_sntrup761x25519test.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup761x25519test.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,77 @@
+/*
+20210316
+Jan Mojzis
+Public domain.
+*/
+
+#include "misc.h"
+#include "crypto_kem_sntrup761x25519.h"
+#include "crypto_kem_sntrup761x25519test.data"
+
+unsigned char sk[crypto_kem_sntrup761x25519_SECRETKEYBYTES + 16];
+unsigned char pk[crypto_kem_sntrup761x25519_PUBLICKEYBYTES + 16];
+unsigned char c[crypto_kem_sntrup761x25519_CIPHERTEXTBYTES + 16];
+unsigned char k1[crypto_kem_sntrup761x25519_BYTES + 16];
+unsigned char k2[crypto_kem_sntrup761x25519_BYTES + 16];
+#define xk2 k2
+
+static void test_random(void) {
+
+    long long i, j;
+
+    for (i = 0; i < 16; ++i) {
+        if (crypto_kem_sntrup761x25519_keypair(pk + i, sk + i) != 0) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761x25519_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761x25519_SECRETKEYBYTES);
+            fail("crypto_kem_sntrup761x25519_keypair() failure, please report it !!!!!!!!!");
+        }
+        if (crypto_kem_sntrup761x25519_enc(c + i, k1 + i, pk + i) != 0) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761x25519_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761x25519_SECRETKEYBYTES);
+            fail_printdata("c", c + i, crypto_kem_sntrup761x25519_CIPHERTEXTBYTES);
+            fail_printdata("k1", k1 + i, crypto_kem_sntrup761x25519_BYTES);
+            fail("crypto_kem_sntrup761x25519_enc() failure, please report it !!!!!!!!!");
+        }
+        if (crypto_kem_sntrup761x25519_dec(k2 + i, c + i, sk + i) != 0) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761x25519_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761x25519_SECRETKEYBYTES);
+            fail_printdata("c", c + i, crypto_kem_sntrup761x25519_CIPHERTEXTBYTES);
+            fail_printdata("k1", k1 + i, crypto_kem_sntrup761x25519_BYTES);
+            fail_printdata("k2", k2 + i, crypto_kem_sntrup761x25519_BYTES);
+            fail("crypto_kem_sntrup761x25519_dec() failure, please report it !!!!!!!!!");
+        }
+        for (j = 0; j < crypto_kem_sntrup761x25519_BYTES; ++j) if (k1[i + j] != k2[i + j]) {
+            fail_printdata("pk", pk + i, crypto_kem_sntrup761x25519_PUBLICKEYBYTES);
+            fail_printdata("sk", sk + i, crypto_kem_sntrup761x25519_SECRETKEYBYTES);
+            fail_printdata("c", c + i, crypto_kem_sntrup761x25519_CIPHERTEXTBYTES);
+            fail_printdata("k1", k1 + i, crypto_kem_sntrup761x25519_BYTES);
+            fail_printdata("k2", k2 + i, crypto_kem_sntrup761x25519_BYTES);
+            fail("crypto_kem_sntrup761x25519_dec() failure, please report it !!!!!!!!!");
+        }
+    }
+}
+
+static void test_dec(void) {
+
+    long long j;
+
+    if (crypto_kem_sntrup761x25519_dec(xk2, xc, xsk) != 0) {
+        fail_printdata("xk1", xk1, crypto_kem_sntrup761x25519_BYTES);
+        fail_printdata("xk2", xk2, crypto_kem_sntrup761x25519_BYTES);
+        fail("crypto_kem_sntrup761x25519_dec() failure, please report it !!!!!!!!!");
+    }
+    for (j = 0; j < crypto_kem_sntrup761x25519_BYTES; ++j) if (xk1[j] != xk2[j]) {
+        fail_printdata("xk1", xk1, crypto_kem_sntrup761x25519_BYTES);
+        fail_printdata("xk2", xk2, crypto_kem_sntrup761x25519_BYTES);
+        fail("crypto_kem_sntrup761x25519_dec() failure, please report it !!!!!!!!!");
+    }
+}
+
+
+int main(void) {
+
+    test_dec();
+    test_random();
+
+    _exit(0);
+}
diff -pruN 20190101-1/crypto-tests/crypto_kem_sntrup761x25519test.data 20220801-1/crypto-tests/crypto_kem_sntrup761x25519test.data
--- 20190101-1/crypto-tests/crypto_kem_sntrup761x25519test.data	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_kem_sntrup761x25519test.data	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,375 @@
+static unsigned char xsk[] = {
+    0x95, 0x65, 0x19, 0x41, 0x1a, 0x16, 0x40, 0x0a, 
+    0x65, 0x59, 0x04, 0x55, 0x45, 0x49, 0x46, 0x56, 
+    0xa6, 0x56, 0x40, 0xa5, 0x51, 0x96, 0x54, 0x95, 
+    0x16, 0x15, 0x54, 0xa2, 0x55, 0x29, 0x58, 0x59, 
+    0x44, 0x59, 0x45, 0x55, 0xa1, 0x65, 0x95, 0x11, 
+    0x55, 0x54, 0x21, 0x45, 0x56, 0x66, 0x52, 0x55, 
+    0x54, 0x64, 0x85, 0x25, 0x94, 0x41, 0x91, 0x64, 
+    0x55, 0x52, 0x99, 0x51, 0x55, 0x59, 0x11, 0x69, 
+    0x45, 0x12, 0x59, 0x15, 0x40, 0x55, 0x65, 0x44, 
+    0x54, 0x05, 0x44, 0x52, 0x15, 0x59, 0x00, 0x55, 
+    0x51, 0x6a, 0x45, 0x55, 0x96, 0x95, 0x15, 0x42, 
+    0x55, 0x41, 0x55, 0x41, 0x05, 0x01, 0x64, 0x55, 
+    0x55, 0x64, 0x16, 0x95, 0x51, 0x65, 0x49, 0x92, 
+    0x5a, 0x85, 0x16, 0x14, 0x54, 0x14, 0x55, 0x54, 
+    0x5a, 0x15, 0x15, 0x56, 0x55, 0x61, 0x14, 0x55, 
+    0x95, 0x68, 0x55, 0x12, 0x55, 0x14, 0x45, 0x95, 
+    0x85, 0x56, 0x9a, 0x5a, 0x56, 0x45, 0x51, 0x01, 
+    0x5a, 0x51, 0x65, 0x54, 0x65, 0x54, 0x55, 0x65, 
+    0x55, 0x95, 0x94, 0x54, 0x60, 0x45, 0x95, 0x4a, 
+    0x41, 0x55, 0x52, 0x15, 0x9a, 0x61, 0x45, 0x15, 
+    0x56, 0x56, 0x44, 0x55, 0x44, 0x86, 0x45, 0xa9, 
+    0x55, 0x51, 0x69, 0x28, 0x66, 0x19, 0x05, 0x95, 
+    0x55, 0x05, 0x95, 0x56, 0x55, 0x54, 0x11, 0x91, 
+    0x91, 0x25, 0x99, 0x55, 0x65, 0x25, 0x01, 0x88, 
+    0x55, 0x80, 0x80, 0x49, 0x61, 0x51, 0x14, 0x98, 
+    0x22, 0x06, 0x84, 0x44, 0x90, 0x98, 0x8a, 0x99, 
+    0x80, 0x56, 0x16, 0x40, 0xa5, 0xa0, 0x8a, 0x58, 
+    0x1a, 0xa8, 0x69, 0x19, 0xa2, 0x46, 0x4a, 0xa1, 
+    0x20, 0x89, 0xa2, 0x21, 0x00, 0x66, 0x46, 0xa4, 
+    0x6a, 0x21, 0x28, 0xa4, 0x68, 0x4a, 0x4a, 0x02, 
+    0x58, 0xa8, 0x46, 0x40, 0x88, 0x68, 0x15, 0x86, 
+    0x1a, 0x82, 0x25, 0x86, 0x22, 0x65, 0x28, 0x98, 
+    0x49, 0x81, 0x66, 0x68, 0x55, 0x96, 0x68, 0x15, 
+    0x1a, 0x01, 0x51, 0x1a, 0x49, 0x60, 0x55, 0x12, 
+    0x28, 0x09, 0x48, 0x91, 0x84, 0x09, 0x62, 0x42, 
+    0x04, 0x92, 0xa8, 0x90, 0x60, 0x86, 0x55, 0x04, 
+    0x01, 0x65, 0x0a, 0x15, 0x98, 0x90, 0xa1, 0x09, 
+    0xa8, 0x05, 0x52, 0x82, 0x88, 0x44, 0x20, 0x19, 
+    0x49, 0x46, 0xa2, 0x28, 0x64, 0x54, 0x91, 0x11, 
+    0x56, 0x84, 0x88, 0x92, 0x82, 0x80, 0x81, 0x18, 
+    0x94, 0x19, 0x46, 0x24, 0x11, 0x85, 0x2a, 0x15, 
+    0x81, 0x2a, 0x28, 0xa2, 0x85, 0x48, 0x19, 0x2a, 
+    0x40, 0xa8, 0x59, 0x50, 0x59, 0x46, 0x05, 0x66, 
+    0x52, 0x81, 0x91, 0x95, 0x00, 0x25, 0x06, 0x89, 
+    0xa2, 0x55, 0xa0, 0x82, 0x19, 0x58, 0x86, 0x24, 
+    0x85, 0x22, 0x5a, 0xa9, 0x45, 0x5a, 0x54, 0x06, 
+    0x08, 0xa4, 0x29, 0x42, 0x59, 0x09, 0x92, 0x60, 
+    0xa8, 0x19, 0x54, 0x55, 0xa6, 0x02, 0x52, 0x75, 
+    0x1f, 0x67, 0x43, 0x3d, 0x6b, 0x58, 0x58, 0x29, 
+    0x2f, 0x13, 0xf4, 0x0d, 0x41, 0x57, 0xeb, 0x93, 
+    0xd1, 0x65, 0x29, 0x95, 0x3b, 0x08, 0x87, 0x0a, 
+    0x19, 0xce, 0x94, 0xc5, 0x48, 0x86, 0x00, 0x90, 
+    0x7b, 0x74, 0x36, 0x6a, 0x74, 0x9c, 0x00, 0x66, 
+    0xea, 0x94, 0x9a, 0xd1, 0x77, 0x19, 0x3a, 0x57, 
+    0x86, 0x61, 0x96, 0x13, 0x15, 0x64, 0xc9, 0x2b, 
+    0x7b, 0xf5, 0xfe, 0x1c, 0xd2, 0xd3, 0x65, 0x03, 
+    0x87, 0xfe, 0xc3, 0xab, 0x81, 0x23, 0x8f, 0xbe, 
+    0x86, 0xd6, 0x30, 0x1b, 0x09, 0xa1, 0xfc, 0x0a, 
+    0x07, 0x87, 0x11, 0xa7, 0xa8, 0xd9, 0xcf, 0x14, 
+    0x4d, 0x80, 0x78, 0x64, 0x86, 0x0d, 0x9e, 0x02, 
+    0xa6, 0xff, 0xa9, 0x9b, 0x28, 0xc0, 0x6c, 0xec, 
+    0x0d, 0xa3, 0xae, 0x76, 0x9e, 0x78, 0xb9, 0x9f, 
+    0xeb, 0x68, 0x10, 0xfc, 0xcd, 0xec, 0x0e, 0x7a, 
+    0x38, 0xdb, 0xc9, 0xce, 0xd9, 0xda, 0x7e, 0x3e, 
+    0x8e, 0x41, 0xd5, 0x4b, 0x2e, 0xc8, 0x1f, 0x6b, 
+    0xb2, 0xf5, 0x24, 0xa4, 0x74, 0x57, 0xb0, 0xce, 
+    0xb8, 0xc5, 0x05, 0x67, 0x50, 0xfb, 0x02, 0xcc, 
+    0xd2, 0x93, 0xbf, 0x78, 0x53, 0x8c, 0xf5, 0xf4, 
+    0x48, 0x38, 0xe2, 0x93, 0x49, 0x95, 0xce, 0x7c, 
+    0x88, 0xdf, 0xfd, 0x6f, 0x03, 0xdd, 0x67, 0x57, 
+    0x33, 0x9d, 0x3d, 0x4f, 0xf8, 0x44, 0x3b, 0xae, 
+    0xbc, 0xbe, 0x8e, 0xc3, 0xc1, 0x36, 0x75, 0x73, 
+    0x8f, 0xb9, 0x95, 0xcb, 0xe3, 0xeb, 0x92, 0x29, 
+    0x4b, 0x98, 0xcd, 0x60, 0x92, 0xfb, 0x2b, 0x2b, 
+    0x7c, 0xd3, 0xb2, 0x32, 0x5a, 0xba, 0x99, 0x24, 
+    0x6a, 0xf5, 0x9c, 0xa9, 0x63, 0xd5, 0x7d, 0x91, 
+    0x58, 0xe6, 0xfa, 0x4e, 0x1e, 0x13, 0x3c, 0x1b, 
+    0x09, 0x83, 0xc0, 0x5b, 0xd2, 0x5d, 0xe8, 0xdc, 
+    0x42, 0x9f, 0xf7, 0x47, 0x00, 0x83, 0xd6, 0xfb, 
+    0x5d, 0x9c, 0x5a, 0x3b, 0x57, 0xf7, 0xb2, 0x75, 
+    0x38, 0xcf, 0xd8, 0x16, 0x24, 0xb4, 0xf2, 0xb8, 
+    0xcb, 0x8d, 0x02, 0x68, 0xca, 0x53, 0xa2, 0x22, 
+    0x22, 0xdf, 0x38, 0x32, 0x8e, 0xcc, 0xfb, 0xf2, 
+    0x48, 0xaa, 0xaf, 0x05, 0x7b, 0x91, 0x58, 0x87, 
+    0x07, 0xf9, 0x28, 0x4a, 0xa1, 0xef, 0x54, 0xe7, 
+    0x4b, 0xdb, 0x64, 0x15, 0x9c, 0x4f, 0x12, 0x63, 
+    0x88, 0x8a, 0xb9, 0xee, 0xd8, 0x6c, 0x0e, 0x6e, 
+    0xdf, 0xb0, 0xf9, 0x4a, 0x14, 0x06, 0xb5, 0x26, 
+    0xe0, 0xf4, 0x9c, 0x85, 0xdd, 0x6d, 0x23, 0xa9, 
+    0xd6, 0xba, 0x7d, 0x1a, 0x40, 0xf6, 0x26, 0x6e, 
+    0x30, 0x6f, 0xcb, 0xf8, 0x16, 0x25, 0x1a, 0xec, 
+    0x03, 0x31, 0x3a, 0x8c, 0x25, 0x63, 0x9f, 0x1d, 
+    0x64, 0x52, 0x7e, 0x90, 0xaa, 0x83, 0x2d, 0xc6, 
+    0xe6, 0x2e, 0xf2, 0x42, 0x9c, 0x94, 0xdc, 0x86, 
+    0xb3, 0xc5, 0x28, 0x23, 0x3b, 0x60, 0x4d, 0x6d, 
+    0x9b, 0x8f, 0xfc, 0xe3, 0xa7, 0x78, 0x9e, 0x2d, 
+    0x4b, 0x89, 0x62, 0x2a, 0x6e, 0x45, 0x21, 0xc3, 
+    0x70, 0x86, 0xa5, 0x3a, 0x7f, 0x01, 0xc8, 0xc8, 
+    0x62, 0x74, 0x01, 0x62, 0xa6, 0xea, 0x8e, 0x36, 
+    0xf3, 0xab, 0x67, 0x61, 0x87, 0x2f, 0x37, 0x7b, 
+    0xb9, 0x10, 0x0e, 0x1a, 0x61, 0x03, 0x79, 0x10, 
+    0x67, 0x23, 0x25, 0xd1, 0x8e, 0xee, 0x02, 0x97, 
+    0xf2, 0x52, 0xad, 0xf4, 0xe8, 0xb5, 0x1e, 0x60, 
+    0xe8, 0xa4, 0x20, 0x73, 0x3a, 0x26, 0x3e, 0x20, 
+    0xe8, 0x37, 0x41, 0x28, 0x92, 0xd3, 0x28, 0xee, 
+    0xa3, 0xb5, 0xd6, 0xee, 0xef, 0x4a, 0x21, 0x17, 
+    0xe1, 0x57, 0x88, 0x1c, 0x4a, 0xd0, 0x43, 0xb1, 
+    0x24, 0xd1, 0xd2, 0xfa, 0xba, 0x20, 0x1d, 0x9b, 
+    0x8d, 0x04, 0x48, 0xfb, 0x64, 0x21, 0x5e, 0xea, 
+    0x47, 0xb9, 0x01, 0x0f, 0xf3, 0x85, 0x1b, 0x56, 
+    0x64, 0xf7, 0x64, 0x99, 0xaf, 0x26, 0x1c, 0x5a, 
+    0xfe, 0x3c, 0x7f, 0xf3, 0xa8, 0xcb, 0xb6, 0x7c, 
+    0x70, 0x7d, 0xd2, 0xc8, 0x06, 0x2c, 0xe6, 0x46, 
+    0x53, 0x5f, 0x04, 0x63, 0x3d, 0xd8, 0x2b, 0x5a, 
+    0x45, 0xd8, 0x14, 0x33, 0x2f, 0xb3, 0x5a, 0x61, 
+    0x06, 0xa5, 0xf0, 0xc4, 0xa3, 0xf8, 0x7e, 0x92, 
+    0xd5, 0xa6, 0x7d, 0x10, 0xc0, 0x32, 0xec, 0x2b, 
+    0x21, 0x55, 0x5c, 0xc6, 0xcc, 0x9b, 0x4c, 0xe2, 
+    0xc0, 0xa4, 0x90, 0xf5, 0x39, 0xe8, 0xf2, 0xe4, 
+    0x75, 0xdc, 0x51, 0xab, 0xfd, 0x93, 0x5b, 0xeb, 
+    0x26, 0x62, 0x63, 0x29, 0x4e, 0x57, 0x4a, 0xae, 
+    0x30, 0x94, 0x09, 0xc1, 0x28, 0x05, 0x7c, 0x2f, 
+    0xbf, 0x11, 0x41, 0x49, 0xad, 0xed, 0x1a, 0xc5, 
+    0xd2, 0x2f, 0x72, 0x0f, 0x48, 0xe9, 0x9f, 0xf7, 
+    0x5f, 0xb2, 0xd2, 0x4e, 0x64, 0x52, 0x8e, 0xe6, 
+    0x0b, 0x3d, 0x55, 0x1b, 0x05, 0x86, 0x53, 0x7b, 
+    0x8a, 0xd9, 0x5d, 0x59, 0xe6, 0x2e, 0xf1, 0xd7, 
+    0x1e, 0xfc, 0x6c, 0x3c, 0x4b, 0x47, 0xda, 0x55, 
+    0xa0, 0x63, 0x87, 0xac, 0x6f, 0x31, 0x80, 0x41, 
+    0xec, 0x8b, 0x5f, 0x47, 0x0c, 0x1d, 0xe0, 0x38, 
+    0x68, 0x46, 0xfa, 0xd7, 0xd7, 0x33, 0x0f, 0x19, 
+    0x30, 0x29, 0x2a, 0x69, 0x74, 0xa1, 0xec, 0xee, 
+    0x38, 0x33, 0x43, 0xca, 0x65, 0x72, 0x84, 0x6d, 
+    0xae, 0x15, 0x92, 0x5d, 0x49, 0x25, 0x38, 0x68, 
+    0xdd, 0x94, 0xa9, 0x96, 0xf1, 0xe4, 0xe2, 0xf6, 
+    0x12, 0x12, 0x2b, 0xc1, 0x83, 0x9e, 0x0d, 0x0d, 
+    0xb4, 0x82, 0x99, 0x7c, 0xc7, 0x62, 0x70, 0x55, 
+    0x7f, 0x99, 0x96, 0x91, 0x9a, 0x2c, 0x5e, 0xe2, 
+    0x74, 0x0f, 0xab, 0x8b, 0x2d, 0xcc, 0x53, 0x11, 
+    0x74, 0x25, 0x9e, 0x0d, 0x2a, 0xf3, 0x4d, 0xbc, 
+    0x14, 0xfd, 0x20, 0xff, 0x2d, 0x16, 0x04, 0x20, 
+    0x06, 0x3e, 0x26, 0xc3, 0x37, 0xc4, 0x68, 0xc1, 
+    0xeb, 0x40, 0x12, 0xf8, 0xdb, 0x79, 0x1f, 0x44, 
+    0xc9, 0xa7, 0x2b, 0x18, 0xcb, 0xd0, 0x60, 0xba, 
+    0xab, 0x72, 0xb2, 0x8d, 0xc0, 0x13, 0xb6, 0x17, 
+    0x56, 0xac, 0xf1, 0x9a, 0x70, 0x74, 0x1a, 0xe8, 
+    0xc2, 0x05, 0xed, 0xe7, 0x19, 0xaf, 0x94, 0x54, 
+    0x56, 0x51, 0x21, 0x24, 0x8c, 0xdf, 0xc2, 0x35, 
+    0x23, 0x2d, 0x8f, 0xc7, 0x56, 0xba, 0x7a, 0x80, 
+    0x8f, 0x93, 0x87, 0x20, 0x85, 0xbd, 0xbe, 0x94, 
+    0x60, 0x9c, 0xb5, 0x3c, 0x43, 0xe7, 0xf4, 0x34, 
+    0x29, 0xd4, 0xd8, 0xef, 0xc4, 0xa2, 0x08, 0x04, 
+    0x7b, 0x5b, 0xf5, 0xe8, 0xe7, 0xd4, 0x2d, 0x81, 
+    0x90, 0xc9, 0xb1, 0xad, 0x48, 0x13, 0xd1, 0x00, 
+    0x71, 0x8e, 0x1a, 0xf9, 0xa4, 0xa9, 0x2a, 0x98, 
+    0x51, 0xaf, 0x54, 0xb8, 0x6c, 0xe4, 0xf7, 0x57, 
+    0xd0, 0x46, 0x70, 0x1e, 0x79, 0xd3, 0xf2, 0xfa, 
+    0x52, 0xa9, 0x01, 0x84, 0x21, 0xd7, 0xb0, 0xb6, 
+    0x7b, 0x58, 0xc2, 0x60, 0xbb, 0x97, 0xe1, 0xe9, 
+    0x68, 0x1a, 0x53, 0x68, 0x34, 0x32, 0x36, 0x5f, 
+    0x76, 0x76, 0x67, 0xfa, 0xec, 0x77, 0xe8, 0x39, 
+    0xe3, 0x9e, 0x53, 0x27, 0xc9, 0xac, 0x82, 0x8b, 
+    0x63, 0x17, 0x59, 0x53, 0xe7, 0x37, 0xa8, 0x04, 
+    0x16, 0x44, 0x82, 0x64, 0x19, 0xef, 0x9c, 0x32, 
+    0x15, 0xdb, 0xa0, 0x7f, 0x95, 0xf1, 0x71, 0xe7, 
+    0xf4, 0x5b, 0x60, 0xa9, 0x3d, 0xa3, 0x84, 0x5a, 
+    0x4a, 0xad, 0x1f, 0xa0, 0xc2, 0xaf, 0x6b, 0x95, 
+    0x86, 0xbb, 0x7d, 0x70, 0x45, 0x7f, 0xb2, 0x11, 
+    0xe1, 0x5a, 0x26, 0x57, 0x5f, 0xbf, 0x44, 0xec, 
+    0xa5, 0x3f, 0xc1, 0xd4, 0x63, 0x3a, 0x86, 0xe9, 
+    0x85, 0x41, 0xdb, 0xd0, 0x91, 0xfa, 0x8d, 0x01, 
+    0xec, 0x17, 0x01, 0xb1, 0x6c, 0x82, 0xa2, 0x66, 
+    0x59, 0x36, 0x23, 0x91, 0xc2, 0x1b, 0xa7, 0x79, 
+    0xd6, 0x1a, 0xa2, 0xf1, 0x8d, 0x79, 0xce, 0x4e, 
+    0x77, 0x49, 0x70, 0x97, 0xb0, 0x98, 0x4a, 0xc7, 
+    0x89, 0xf7, 0xae, 0x84, 0x44, 0x54, 0x66, 0x63, 
+    0xe0, 0x25, 0xfa, 0xf5, 0xe7, 0xf7, 0x20, 0x4e, 
+    0xd5, 0xb6, 0x55, 0xfb, 0x1f, 0xdb, 0x21, 0x23, 
+    0x2a, 0x7a, 0xe2, 0x61, 0x38, 0xdb, 0x6a, 0x13, 
+    0x99, 0x9f, 0xc6, 0xed, 0xbc, 0xe5, 0x77, 0x36, 
+    0xd6, 0xd5, 0xf1, 0xb3, 0xdf, 0x7b, 0xe0, 0x72, 
+    0xfd, 0x43, 0x2d, 0xfe, 0x47, 0x9a, 0xd8, 0x99, 
+    0xc6, 0xf1, 0x3c, 0x67, 0xb4, 0xf5, 0xf1, 0xcb, 
+    0x51, 0xb4, 0x5f, 0xc6, 0x98, 0xbc, 0xde, 0xad, 
+    0x68, 0x7e, 0x1a, 0x5f, 0xf0, 0xff, 0x64, 0x8d, 
+    0xd9, 0xd5, 0x7d, 0x96, 0x9e, 0x8d, 0xf7, 0x8e, 
+    0xcf, 0x3d, 0x74, 0xc5, 0x0a, 0xcb, 0x95, 0x58, 
+    0xb7, 0x88, 0xb7, 0xa0, 0x93, 0xe4, 0x07, 0x6a, 
+    0xf5, 0x6a, 0x3b, 0xe1, 0x8b, 0x74, 0x81, 0x0e, 
+    0x8c, 0x53, 0x0a, 0xf2, 0x56, 0x82, 0x57, 0x10, 
+    0x13, 0x85, 0xf9, 0xd3, 0x22, 0x3f, 0xb3, 0x60, 
+    0x4b, 0x67, 0x70, 0x95, 0xa9, 0x4d, 0x8b, 0xa4, 
+    0x8a, 0xb9, 0x34, 0x03, 0x74, 0x17, 0x8f, 0x26, 
+    0xa8, 0x35, 0x7f, 0x37, 0x82, 0x84, 0xda, 0xf0, 
+    0xc7, 0x87, 0x7a, 0xb9, 0xbd, 0x1e, 0xe0, 0xea, 
+    0x15, 0xd1, 0xcc, 0x69, 0x04, 0x81, 0x67, 0xd6, 
+    0x19, 0x08, 0xc3, 0x2c, 0x53, 0x51, 0x84, 0x23, 
+    0x46, 0xe3, 0x7e, 0x18, 0xfe, 0xda, 0x8f, 0xe0, 
+    0x3f, 0xa7, 0x81, 0x68, 0xdb, 0x46, 0xcd, 0x4c, 
+    0x5c, 0x6b, 0x80, 0x2c, 0x4c, 0xd8, 0xb4, 0x62, 
+    0xc8, 0x3a, 0xcb, 0xac, 0xc1, 0x58, 0x20, 0xa0, 
+    0xfb, 0x5a, 0xed, 0x4f, 0x15, 0xee, 0x20, 0xfd, 
+    0xc5, 0xb6, 0xc4, 0x41, 0x29, 0xb0, 0xf8, 0x11, 
+    0x61, 0xae, 0x90, 0x03, 0xcd, 0x28, 0xc6, 0xce, 
+    0xd2, 0x34, 0xd7, 0x9c, 0x55, 0x4a, 0xaf, 0xba, 
+    0x30, 0xeb, 0x43, 0x5f, 0x89, 0xd3, 0x01, 0xde, 
+    0x2f, 0xd8, 0x6d, 0x95, 0xfa, 0xb4, 0x67, 0x64, 
+    0x1f, 0x71, 0xcc, 0xbe, 0x37, 0x46, 0x58, 0x86, 
+    0x0d, 0xca, 0x2d, 0xd3, 0x1d, 0x60, 0x83, 0xe3, 
+    0xd2, 0x96, 0x47, 0xc2, 0xfb, 0xe5, 0x20, 0x1e, 
+    0x6c, 0x08, 0xc4, 0x26, 0x71, 0x0b, 0xab, 0x10, 
+    0x59, 0xc6, 0x29, 0xe8, 0xb5, 0x5b, 0x2c, 0x88, 
+    0xae, 0x56, 0x2d, 0x1e, 0xe4, 0xc3, 0xc0, 0x2b, 
+    0x44, 0xc5, 0xf2, 0xbd, 0xa7, 0x23, 0x3b, 0xe3, 
+    0x7d, 0xb4, 0xfb, 0x8b, 0x0e, 0xf5, 0x13, 0x41, 
+    0x19, 0x46, 0x9d, 0xd2, 0x2b, 0x33, 0x0b, 0x57, 
+    0xa8, 0xba, 0x7a, 0x70, 0xed, 0xfc, 0x50, 0x54, 
+    0xc0, 0x34, 0x95, 0x93, 0x08, 0x7e, 0x0c, 0x4d, 
+    0x42, 0x49, 0xc8, 0x7e, 0x5d, 0xf7, 0x08, 0x8f, 
+    0xf0, 0xd6, 0x8a, 0x6e, 0x95, 0xdf, 0x97, 0x32, 
+    0x78, 0x1d, 0xd6, 0xea, 0x5a, 0x06, 0xc8, 0x78, 
+    0x67, 0x9b, 0x95, 0xb3, 0xff, 0x32, 0xd8, 0xb7, 
+    0x66, 0x62, 0x29, 0xce, 0x68, 0x13, 0x15, 0xd8, 
+    0x31, 0xc7, 0xe8, 0xd6, 0x53, 0x1f, 0xf6, 0x92, 
+    0x38, 0xac, 0x09
+};
+
+static unsigned char xc[] = {
+    0xf1, 0x43, 0x60, 0x72, 0x21, 0x2b, 0x90, 0xc7, 
+    0x57, 0x44, 0x2f, 0xd7, 0x5b, 0x43, 0xc5, 0x3b, 
+    0x7b, 0x33, 0x67, 0x84, 0xb6, 0xa3, 0x4a, 0x28, 
+    0xf3, 0x53, 0xd6, 0x7c, 0x83, 0x58, 0xb6, 0x43, 
+    0x26, 0x5f, 0xf3, 0xa8, 0x7e, 0x57, 0x73, 0xa6, 
+    0x10, 0x30, 0x12, 0x90, 0x52, 0x77, 0x00, 0x4d, 
+    0x77, 0xfb, 0x05, 0x1c, 0x0d, 0xd3, 0x64, 0xc1, 
+    0x69, 0x19, 0x5a, 0xb8, 0x1c, 0x9b, 0x6e, 0x09, 
+    0x3d, 0xff, 0xc7, 0xf4, 0x89, 0x57, 0x1b, 0x28, 
+    0xde, 0x41, 0x11, 0x74, 0x63, 0x3a, 0xa6, 0xc2, 
+    0x4b, 0xcc, 0x3a, 0xa9, 0xa5, 0x3b, 0x1d, 0x30, 
+    0xe4, 0xdc, 0x3a, 0xdc, 0xa8, 0xc5, 0xa4, 0x6c, 
+    0x14, 0xae, 0xd8, 0x20, 0xf1, 0xb9, 0x21, 0xae, 
+    0xf1, 0x9a, 0x22, 0x14, 0x01, 0x53, 0xc6, 0x25, 
+    0x64, 0x79, 0x75, 0x27, 0x56, 0x18, 0xf9, 0xd0, 
+    0x4a, 0x04, 0xb9, 0xef, 0x74, 0xc4, 0xa9, 0xfc, 
+    0x47, 0xb2, 0x99, 0xa3, 0x68, 0x48, 0x06, 0xd5, 
+    0x11, 0x9f, 0x03, 0x36, 0xff, 0xa2, 0x9a, 0xd8, 
+    0xfb, 0xb3, 0xd0, 0xe9, 0xf3, 0x58, 0x02, 0xd4, 
+    0x8a, 0x4f, 0xd7, 0x7c, 0xdb, 0xe4, 0xb8, 0xbc, 
+    0x8d, 0x32, 0xdd, 0x94, 0xe5, 0xdf, 0xe3, 0x15, 
+    0x12, 0xe0, 0x81, 0xcc, 0x67, 0xe6, 0xe3, 0xb0, 
+    0xd1, 0x40, 0x9e, 0x2b, 0x13, 0xc5, 0x57, 0x24, 
+    0xaf, 0xe0, 0x92, 0x3c, 0xa9, 0x9f, 0x47, 0xb5, 
+    0x00, 0x90, 0xfc, 0x72, 0xb8, 0xcb, 0xcf, 0xf4, 
+    0xae, 0x52, 0x8e, 0xa6, 0x9d, 0x7b, 0x15, 0x0b, 
+    0xf5, 0xd2, 0x6c, 0xe1, 0xe8, 0xd7, 0x05, 0x09, 
+    0x1a, 0x9a, 0xfd, 0x6b, 0x29, 0x7b, 0x1d, 0x37, 
+    0xa1, 0x5e, 0x93, 0x37, 0xd9, 0xd6, 0x0d, 0x06, 
+    0x4c, 0x04, 0x8a, 0xb9, 0xfd, 0xc2, 0x7b, 0xd8, 
+    0x74, 0x13, 0x3f, 0x25, 0xb2, 0x35, 0x24, 0x3a, 
+    0x96, 0x7e, 0x4d, 0x0b, 0x49, 0x53, 0x6d, 0x7e, 
+    0x0b, 0xdf, 0xd3, 0xfc, 0x1c, 0x36, 0x3f, 0x7d, 
+    0x42, 0xdd, 0x0f, 0x5b, 0x50, 0xd5, 0x01, 0xd8, 
+    0x09, 0x59, 0xaa, 0xdb, 0x19, 0x9f, 0xb7, 0xd4, 
+    0x6f, 0x12, 0xe5, 0x73, 0x3c, 0x58, 0x86, 0xc9, 
+    0x34, 0x91, 0xbb, 0xdd, 0x31, 0x57, 0xaf, 0xaf, 
+    0x08, 0x3a, 0x21, 0x96, 0xc0, 0xf0, 0x84, 0xc0, 
+    0x4a, 0x1c, 0xfd, 0x86, 0xe6, 0xb1, 0xc3, 0xec, 
+    0x9d, 0x7f, 0x86, 0x4d, 0xaa, 0xd4, 0x3a, 0x6e, 
+    0xb3, 0xe1, 0x89, 0xcc, 0x63, 0x64, 0x9c, 0x55, 
+    0xe9, 0x20, 0xfc, 0xaa, 0x77, 0x77, 0x89, 0x09, 
+    0x8c, 0x53, 0x1f, 0x9b, 0xbd, 0x1f, 0xda, 0x22, 
+    0x1d, 0xa7, 0x19, 0x96, 0x31, 0x4b, 0x1a, 0x56, 
+    0x59, 0xe9, 0x86, 0x73, 0x44, 0xcb, 0x75, 0x98, 
+    0xed, 0x9c, 0xa1, 0xcc, 0xf6, 0xf5, 0x4e, 0x01, 
+    0x9d, 0xc0, 0xb4, 0xa4, 0x4d, 0x46, 0xeb, 0x03, 
+    0xd2, 0x02, 0x86, 0x46, 0x50, 0x5e, 0x9a, 0xc8, 
+    0x17, 0x0f, 0xf4, 0x37, 0x5a, 0xc8, 0xce, 0x17, 
+    0x68, 0x61, 0x5f, 0xe1, 0x2d, 0xf1, 0x83, 0x25, 
+    0xf5, 0xd4, 0x53, 0xf6, 0x59, 0x06, 0x16, 0xfd, 
+    0xca, 0x80, 0x18, 0x0e, 0x81, 0x50, 0x2a, 0x31, 
+    0xc1, 0x6a, 0x9f, 0xd1, 0xcb, 0x2f, 0xf5, 0x9c, 
+    0xe2, 0x5f, 0x32, 0x76, 0xff, 0x4c, 0xe4, 0x86, 
+    0x48, 0xe4, 0xf3, 0x62, 0x05, 0x40, 0x8c, 0x3c, 
+    0xd1, 0xb1, 0x6b, 0x06, 0x4b, 0x79, 0x99, 0x15, 
+    0x74, 0x34, 0x32, 0x7a, 0x41, 0x39, 0xe4, 0x98, 
+    0xcb, 0x01, 0x98, 0x70, 0x11, 0x3c, 0xee, 0xe1, 
+    0x64, 0x55, 0xa2, 0x29, 0x99, 0xbb, 0x66, 0xb0, 
+    0x19, 0x2f, 0x41, 0x54, 0x96, 0x8f, 0x77, 0xb2, 
+    0x2b, 0x88, 0xdd, 0xa7, 0xaf, 0xb0, 0x84, 0x20, 
+    0x9c, 0x5d, 0x83, 0x43, 0x35, 0x08, 0x42, 0xb5, 
+    0x0c, 0x6d, 0x0a, 0xb0, 0xf5, 0xa6, 0x5b, 0xf2, 
+    0x06, 0xcd, 0x43, 0x41, 0x39, 0x96, 0x36, 0x4e, 
+    0x08, 0x94, 0x5a, 0x2c, 0x49, 0x0a, 0xee, 0x33, 
+    0x32, 0x8c, 0x98, 0x4b, 0x97, 0x4f, 0x89, 0x82, 
+    0x6f, 0x57, 0x72, 0xdd, 0xb5, 0xdc, 0x9b, 0x7f, 
+    0xc4, 0x00, 0x7b, 0x88, 0xb2, 0x1a, 0xc0, 0x06, 
+    0x2c, 0x08, 0x9e, 0xcf, 0x70, 0x43, 0x57, 0x8b, 
+    0xb7, 0xc6, 0xa9, 0x5c, 0xe9, 0x1c, 0x79, 0xf6, 
+    0xbf, 0x0c, 0x66, 0x36, 0xc4, 0xf6, 0xca, 0xe4, 
+    0x5b, 0xe4, 0xb0, 0x60, 0xc3, 0xcd, 0xdd, 0xed, 
+    0x0c, 0xff, 0xe2, 0x60, 0xd3, 0x2a, 0x58, 0x81, 
+    0x48, 0xd1, 0x60, 0xf5, 0x35, 0x1c, 0x82, 0x68, 
+    0xbd, 0xf8, 0xc1, 0x5d, 0x31, 0xce, 0x68, 0xb1, 
+    0x8d, 0x9f, 0x06, 0xe4, 0x69, 0x87, 0x3a, 0xf1, 
+    0x6e, 0xd3, 0x1c, 0x86, 0x3e, 0xe2, 0xf0, 0x13, 
+    0x1b, 0xde, 0x89, 0x5f, 0x90, 0x5f, 0xcb, 0x3d, 
+    0xd4, 0xdf, 0x0d, 0xf3, 0x81, 0x2b, 0x43, 0xda, 
+    0x82, 0xd4, 0x12, 0xbf, 0x26, 0x32, 0xdf, 0x60, 
+    0x15, 0x87, 0x7d, 0x70, 0x60, 0xeb, 0x25, 0x2a, 
+    0xe1, 0x10, 0xda, 0xaa, 0x8d, 0x2f, 0xb8, 0x1e, 
+    0x79, 0xb8, 0x7c, 0x3b, 0x4a, 0xc6, 0xc8, 0x81, 
+    0x4a, 0x05, 0xc0, 0x2c, 0x7d, 0xe7, 0x2d, 0x34, 
+    0x57, 0xec, 0xdb, 0x81, 0x89, 0x0c, 0x72, 0xce, 
+    0x28, 0xcc, 0x5a, 0x56, 0x9d, 0x21, 0xb0, 0x0d, 
+    0x72, 0xba, 0xc8, 0x68, 0x91, 0x70, 0xb1, 0x15, 
+    0xf9, 0x2a, 0xe2, 0x59, 0x1c, 0xcc, 0x1e, 0x6d, 
+    0x40, 0x24, 0x11, 0xef, 0x42, 0xa7, 0x4c, 0x36, 
+    0x10, 0xbe, 0x09, 0x75, 0x57, 0xcc, 0xb0, 0x48, 
+    0x8a, 0xb7, 0xf7, 0xb8, 0xd2, 0xb2, 0x8e, 0xea, 
+    0x42, 0xfd, 0x3e, 0x86, 0x24, 0x31, 0x2c, 0x95, 
+    0x5e, 0x6b, 0xab, 0xe5, 0x62, 0xb0, 0x49, 0xde, 
+    0x41, 0xbf, 0x01, 0x76, 0x04, 0xdf, 0x3a, 0x0d, 
+    0xfb, 0x44, 0x94, 0x98, 0xa3, 0xdd, 0x6a, 0xf9, 
+    0xe8, 0x91, 0x80, 0x13, 0x45, 0xc5, 0xdb, 0x9f, 
+    0xe4, 0x4d, 0x3f, 0x2a, 0xde, 0x2a, 0xf8, 0xf6, 
+    0x93, 0x88, 0x3c, 0x29, 0xc5, 0xa9, 0xfb, 0x28, 
+    0xcd, 0x64, 0x96, 0x51, 0x76, 0x50, 0x1a, 0x07, 
+    0x68, 0x83, 0x56, 0x03, 0x82, 0x48, 0x81, 0xf8, 
+    0x7c, 0x5a, 0x21, 0xe8, 0x22, 0x62, 0xeb, 0x10, 
+    0xd2, 0x07, 0x5e, 0x0a, 0x26, 0x0c, 0x5c, 0xa2, 
+    0xf5, 0x5f, 0xe3, 0xc6, 0xa3, 0x88, 0x1e, 0x32, 
+    0xcd, 0xb2, 0xb9, 0xa9, 0x12, 0xbc, 0xd5, 0xc3, 
+    0xe4, 0x4c, 0x82, 0xfc, 0xbb, 0xc1, 0x98, 0x8b, 
+    0xa1, 0xdc, 0x80, 0x7b, 0x45, 0x97, 0xf9, 0x30, 
+    0x53, 0x00, 0x82, 0x40, 0x29, 0x9f, 0xeb, 0xd1, 
+    0x6a, 0x37, 0xd1, 0x6e, 0x11, 0x0f, 0x35, 0x8d, 
+    0x57, 0x2e, 0xed, 0x13, 0xbd, 0x64, 0xa8, 0x26, 
+    0x79, 0xb7, 0xb8, 0x84, 0x27, 0x32, 0x40, 0x73, 
+    0x32, 0xa1, 0x89, 0x97, 0x4f, 0x3d, 0xea, 0xc0, 
+    0xc7, 0x22, 0x68, 0xc7, 0xbc, 0x76, 0x88, 0x05, 
+    0x1e, 0xc5, 0x42, 0xfb, 0x4c, 0x25, 0xab, 0xaf, 
+    0x1d, 0x0c, 0x93, 0xa1, 0xeb, 0xb4, 0x35, 0x6d, 
+    0x9e, 0x01, 0x79, 0x64, 0xa0, 0x97, 0x7f, 0x84, 
+    0x58, 0x86, 0xe2, 0x1a, 0x50, 0x94, 0x99, 0xe3, 
+    0xc1, 0xc5, 0xd7, 0x73, 0xc1, 0xe4, 0x45, 0x60, 
+    0xfc, 0x30, 0x5c, 0x33, 0x44, 0xe7, 0x8d, 0x30, 
+    0x25, 0x5f, 0x79, 0x44, 0xc6, 0xfb, 0x38, 0xb6, 
+    0x5d, 0xd9, 0x54, 0x96, 0xb7, 0xfb, 0x67, 0x22, 
+    0x17, 0x65, 0xf5, 0x2d, 0x4b, 0xe4, 0x18, 0x00, 
+    0xb3, 0x6d, 0x5c, 0x1a, 0x89, 0x3f, 0xe1, 0x7e, 
+    0xc7, 0xf5, 0x4d, 0x3b, 0x9f, 0x4c, 0xc9, 0x5d, 
+    0x9f, 0xa4, 0x98, 0x06, 0x3c, 0xb6, 0xac, 0x89, 
+    0x80, 0x90, 0x25, 0x4e, 0x53, 0x05, 0xc5, 0x9f, 
+    0x40, 0xa0, 0xdb, 0x3b, 0x95, 0xf0, 0x09, 0xd8, 
+    0xeb, 0x00, 0x31, 0x95, 0xc6, 0x8a, 0x8e, 0xfa, 
+    0xd9, 0xb5, 0x82, 0xea, 0xa9, 0x9a, 0x14, 0xea, 
+    0x70, 0x00, 0xbe, 0x48, 0xa5, 0x64, 0x6a, 0x66, 
+    0x77, 0xc6, 0xc5, 0x7a, 0x37, 0x59, 0xf7, 0xb5, 
+    0xea, 0x38, 0xb4, 0x1d, 0x2f, 0xe4, 0xe4, 0x90, 
+    0x39, 0xc3, 0xca, 0x96, 0x69, 0x98, 0x4e, 0xf3, 
+    0xd4, 0x45, 0x36, 0x24, 0xb0, 0xe3, 0x08, 0x41, 
+    0x67, 0x34, 0xcd, 0xe0, 0x0c, 0x9f, 0x02
+};
+
+static unsigned char xk1[] = {
+    0xb7, 0x19, 0xb0, 0xae, 0x96, 0x55, 0xe7, 0x35, 
+    0xbb, 0x84, 0x0a, 0x09, 0xd7, 0x66, 0x8b, 0xd2, 
+    0x65, 0xd2, 0x23, 0x59, 0xf9, 0xc3, 0x75, 0xdb, 
+    0x3c, 0xb4, 0x35, 0x89, 0xaf, 0xf1, 0xd9, 0x8b, 
+    0x52, 0x8b, 0x3f, 0x2e, 0xfc, 0x41, 0x4a, 0x82, 
+    0x10, 0xb2, 0x42, 0x89, 0xa3, 0x8d, 0xdf, 0x15, 
+    0x50, 0x7d, 0x97, 0x27, 0x20, 0x12, 0x13, 0xaa, 
+    0xf2, 0x7a, 0x83, 0x28, 0xd4, 0x20, 0x19, 0x02
+};
diff -pruN 20190101-1/crypto-tests/crypto_sort_uint32test.c 20220801-1/crypto-tests/crypto_sort_uint32test.c
--- 20190101-1/crypto-tests/crypto_sort_uint32test.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/crypto-tests/crypto_sort_uint32test.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,34 @@
+#include "misc.h"
+#include "crypto_uint32.h"
+#include "crypto_sort_uint32.h"
+
+static void test_321(void) {
+
+    crypto_uint32 x[3] = {3, 2, 1};
+
+    crypto_sort_uint32(x, 3);
+
+    if (x[0] != 1) fail("crypto_sort_uint32() failure");
+    if (x[1] != 2) fail("crypto_sort_uint32() failure");
+    if (x[2] != 3) fail("crypto_sort_uint32() failure");
+}
+
+static void test_i(void) {
+
+    crypto_uint32 x[5] = { (crypto_uint32) -1, (crypto_uint32) -2, 2, 1, 0};
+
+    crypto_sort_uint32(x, 5);
+
+    if (x[0] != 0) fail("crypto_sort_uint32() failure");
+    if (x[1] != 1) fail("crypto_sort_uint32() failure");
+    if (x[2] != 2) fail("crypto_sort_uint32() failure");
+    if (x[3] != (crypto_uint32) -2) fail("crypto_sort_uint32() failure");
+    if (x[4] != (crypto_uint32) -1) fail("crypto_sort_uint32() failure");
+}
+
+int main(void) {
+
+    test_321();
+    test_i();
+    _exit(0);
+}
diff -pruN 20190101-1/debian/changelog 20220801-1/debian/changelog
--- 20190101-1/debian/changelog	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/changelog	2022-08-01 06:28:20.000000000 +0000
@@ -1,3 +1,56 @@
+tinyssh (20220801-1) unstable; urgency=medium
+
+  * New upstream version 20220801
+  * d/gbp.conf added new gbp.conf configuration file
+  * d/control: bump Standards-Version to 4.6.1, no changes
+
+ -- Jan Mojžíš <jan.mojzis@gmail.com>  Mon, 01 Aug 2022 08:28:20 +0200
+
+tinyssh (20220311-2) unstable; urgency=medium
+
+  [ Colin Watson ]
+  * d/rules: ensure non-zero exit status when dh_auto_build fails
+
+  [ Jan Mojžíš ]
+  * debian/systemd/tinysshd: update systemd service to accept status code 111
+
+ -- Jan Mojžíš <jan.mojzis@gmail.com>  Wed, 16 Mar 2022 17:19:43 +0100
+
+tinyssh (20220311-1) unstable; urgency=medium
+
+  * New upstream version 20220311
+    - fixed build on big-endian platforms
+
+ -- Jan Mojžíš <jan.mojzis@gmail.com>  Sat, 12 Mar 2022 12:55:53 +0000
+
+tinyssh (20220305-1) unstable; urgency=medium
+
+  * d/watch - fixed github perl regexp
+  * d/control - bump debhelper compat level to 13
+  * d/control - bump to standards version 4.6.0 (no modifications)
+  * d/control - added Rules-Requires-Root: no
+  * d/tests - added 07kex test, tests supported KEX including
+    new sntrup761x25519-sha512@openssh.com
+  * d/tests - removed unnecessary restrictions allow-stderr, needs-root
+  * d/tests - added 08badauth test, it tests if tinysshd rejects login
+    when authorized_keys are stored in directory with group/other writable
+    permitions
+  * d/rules - fixed cross-compile build
+  * d/tinysshd.manpages man/tinysshd-{make,print}key.1 renamed to
+    man/tinysshd-{make,print}key.8
+  * d/rules - disable some case tests to allow reproducible build
+  * New upstream version 20220305
+    - removed sntrup4591761x25519-sha512@tinyssh.org
+    - added sntrup761x25519-sha512@openssh.com
+    - fixed error message when second channel is requested (Closes: 995146)
+    - man/tinysshd-{make,print}key.1 -> man/tinysshd-{make,print}key.8
+    - added tinysshnoneauthd binary
+    - workaround for incoming packets that doesn't honor
+      the max. packet length (Closes: 1006801)
+  * d/watch - fixed regexp
+
+ -- Jan Mojžíš <jan.mojzis@gmail.com>  Thu, 10 Mar 2022 17:43:02 +0000
+
 tinyssh (20190101-1) unstable; urgency=medium
 
   * d/tests - added 03exitcodes test, it creates ssh connection, exits
diff -pruN 20190101-1/debian/control 20220801-1/debian/control
--- 20190101-1/debian/control	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/control	2022-08-01 06:28:20.000000000 +0000
@@ -1,16 +1,16 @@
 Source: tinyssh
 Section: net
 Priority: optional
-Build-Depends: debhelper-compat (= 12)
+Build-Depends: debhelper-compat (= 13)
 Maintainer: Jan Mojžíš <jan.mojzis@gmail.com>
 Homepage: https://mojzis.com/software/tinyssh/
-Standards-Version: 4.3.0
+Standards-Version: 4.6.1
 Vcs-Git: https://salsa.debian.org/debian/tinyssh.git
 Vcs-Browser: https://salsa.debian.org/debian/tinyssh
+Rules-Requires-Root: no
 
 Package: tinysshd
-Depends: ${misc:Depends},
-         ${shlibs:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Provides: ssh-server
 Architecture: any
 Description: Tiny SSH server - daemon
diff -pruN 20190101-1/debian/gbp.conf 20220801-1/debian/gbp.conf
--- 20190101-1/debian/gbp.conf	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/debian/gbp.conf	2022-08-01 06:28:20.000000000 +0000
@@ -0,0 +1,9 @@
+[DEFAULT]
+debian-branch = master
+upstream-branch = upstream
+upstream-tag = upstream/%(version)s
+pristine-tar = True
+sign-tags = True
+
+[import-orig]
+merge-mode = replace
diff -pruN 20190101-1/debian/.gitlab-ci.yml 20220801-1/debian/.gitlab-ci.yml
--- 20190101-1/debian/.gitlab-ci.yml	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/.gitlab-ci.yml	1970-01-01 00:00:00.000000000 +0000
@@ -1,19 +0,0 @@
-include: https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
-
-build:
-    extends: .build-unstable
-
-# XXX - under reprotest tinyssh can't be build, opentest.c test fails
-#reprotest:
-#    extends: .test-reprotest
-
-lintian:
-    extends: .test-lintian
-    after_script:
-        - lintian --pedantic --display-info --info --display-experimental --allow-root ${WORKING_DIR}/*.changes
-
-autopkgtest:
-    extends: .test-autopkgtest
-
-piuparts:
-    extends: .test-piuparts
diff -pruN 20190101-1/debian/rules 20220801-1/debian/rules
--- 20190101-1/debian/rules	2018-10-23 12:44:40.000000000 +0000
+++ 20220801-1/debian/rules	2022-08-01 06:28:20.000000000 +0000
@@ -4,6 +4,11 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
+# crossbuild
+ifneq  ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+include /usr/share/dpkg/buildtools.mk
+endif
+
 override_dh_installsystemd:
 	dh_installsystemd -ptinysshd tinysshd@.service
 	dh_installsystemd -ptinysshd tinysshd.socket
@@ -11,8 +16,31 @@ override_dh_installsystemd:
 override_dh_auto_install:
 	echo >/dev/null
 
+override_dh_auto_configure:
+	# disable some case tests, to allow reproducible build
+	( cd tinyssh-tests; [ -f opentest.c.orig ] || ( mv opentest.c opentest.c.orig; ln -s emptytest.c opentest.c; ) )
+	( cd tinyssh-tests; [ -f dropuidgidtest.c.orig ] || ( mv dropuidgidtest.c dropuidgidtest.c.orig; ln -s emptytest.c dropuidgidtest.c; ) )
+	( cd tinyssh-tests; [ -f subprocess_authtest.c.orig ] || ( mv subprocess_authtest.c subprocess_authtest.c.orig; ln -s emptytest.c subprocess_authtest.c; ) )
+	# backup files
+	[ -f 'conf-cc.orig' ] || cp 'conf-cc' 'conf-cc.orig'
+	[ -f 'conf-ar.orig' ] || cp 'conf-ar' 'conf-ar.orig'
+	echo '$(CC)' > conf-cc
+	echo '$(AR)' > conf-ar
+
 override_dh_auto_build:
-	dh_auto_build || cat build/log
+ifneq  ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+	make cross-compile || { cat build/log; exit 1; }
+else
+	dh_auto_build || { cat build/log; exit 1; }
+endif
+
+override_dh_auto_clean:
+	dh_auto_clean
+	mv -f 'tinyssh-tests/opentest.c.orig' 'tinyssh-tests/opentest.c' || :
+	mv -f 'tinyssh-tests/dropuidgidtest.c.orig' 'tinyssh-tests/dropuidgidtest.c' || :
+	mv -f 'tinyssh-tests/subprocess_authtest.c.orig' 'tinyssh-tests/subprocess_authtest.c' || :
+	mv -f 'conf-cc.orig' 'conf-cc' || :
+	mv -f 'conf-ar.orig' 'conf-ar' || :
 
 %:
 	dh $@
diff -pruN 20190101-1/debian/systemd/tinysshd@.service 20220801-1/debian/systemd/tinysshd@.service
--- 20190101-1/debian/systemd/tinysshd@.service	2018-10-22 06:02:19.000000000 +0000
+++ 20220801-1/debian/systemd/tinysshd@.service	2022-08-01 06:28:20.000000000 +0000
@@ -8,6 +8,7 @@ ExecStartPre=-/usr/sbin/tinysshd-makekey
 EnvironmentFile=-/etc/default/tinysshd
 ExecStart=/usr/sbin/tinysshd ${TINYSSHDOPTS} -- /etc/tinyssh/sshkeydir
 KillMode=process
+SuccessExitStatus=111
 StandardInput=socket
 StandardError=journal
 
diff -pruN 20190101-1/debian/tests/01makekeyprintkey 20220801-1/debian/tests/01makekeyprintkey
--- 20190101-1/debian/tests/01makekeyprintkey	2018-10-22 06:09:56.000000000 +0000
+++ 20220801-1/debian/tests/01makekeyprintkey	2022-08-01 06:28:20.000000000 +0000
@@ -13,11 +13,10 @@ PATH="/usr/sbin:/sbin:${PATH}"
 export PATH
 
 #check tinysshd-makekey and tinysshd-printkey
-#note that: tinysshd-printkey prints on stderr -> 'allow stderr' in control
 rm -rf keydir
 tinysshd-makekey keydir
 tinysshd-printkey keydir
 rm -rf keydir
 
-echo "tinysshd-makekey and tinysshd-printkey works" >&2
+echo "tinysshd-makekey and tinysshd-printkey works"
 exit 0
diff -pruN 20190101-1/debian/tests/03exitcodes 20220801-1/debian/tests/03exitcodes
--- 20190101-1/debian/tests/03exitcodes	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/tests/03exitcodes	2022-08-01 06:28:20.000000000 +0000
@@ -20,58 +20,70 @@ chmod 700 ~/.ssh
 # run tinysshd on port 10000
 rm -rf sshkeydir
 tinysshd-makekey -q sshkeydir
-tcpserver -HRDl0 127.0.0.1 10000 tinysshd -- sshkeydir &
+tcpserver -HRDl0 127.0.0.1 10000 tinysshd -- sshkeydir 2>tinysshd.log &
 tcpserverpid=$!
 
 cleanup() {
   ex=$?
-  rm -rf ~/.ssh sshkeydir
-  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   #kill tcpserver
   kill -TERM "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
   kill -KILL "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  if [ ${ex} -gt 0 ]; then
+    (
+      echo "homedir:"
+      ls -ld ~ ~/.ssh
+      echo "tinysshd.log:"
+      cat tinysshd.log
+    ) >&2
+  fi
+  rm -rf ~/.ssh sshkeydir tinysshd.log ssh.log
+  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   exit "${ex}"
 }
 trap "cleanup" EXIT TERM INT
 
-# tries login without authorization key
+# add server key to the known_hosts
+ssh-keyscan -H -p 10000 127.0.0.1 2>/dev/null > ~/.ssh/known_hosts
+
+# try login without authorization key
 # must fail
-ssh -o StrictHostKeyChecking=no -p 10000 127.0.0.1 'exit 0'
+ssh -p 10000 127.0.0.1 'exit 0' >ssh.log 2>&1
 exitcode=$?
 if [ x"${exitcode}" = x0 ]; then
   echo "ssh 127.0.0.1:10000 login without authorization key with exit status 0, too bad" >&2
-  exit 3
+  cat ssh.log >&2
+  exit 2
 else
-  echo "ssh 127.0.0.1:10000 login without authorization key failed, this is ok" >&2
+  echo "ssh 127.0.0.1:10000 login without authorization key failed, this is ok:"
 fi
 
 # create authorization keys
-ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 2
-cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 3
+ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 10
+cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 11
 
 # runs remote command which exits with exit status 0 - 255
 # and tests if tinyssh server sends the status do the client
 for code in `seq 0 255`; do
-  ssh -o StrictHostKeyChecking=no -p 10000 127.0.0.1 "exit ${code}"
+  ssh -p 10000 127.0.0.1 "exit ${code}"
   exitcode=$?
   if [ x"${exitcode}" != x"${code}" ]; then
     echo "ssh 127.0.0.1:10000 "'"'"exit ${code}"'"'" failed: tinyssd exited with exit code: ${exitcode}" >&2
-    exit 4
+    exit 3
   else
-    echo "ssh 127.0.0.1:10000 "'"'"exit ${code}"'"'" works" >&2
+    echo "ssh 127.0.0.1:10000 "'"'"exit ${code}"'"'" works"
   fi
 done
 
 # runs command which is killed by signal 9 and 15
 # and tests if tinyssh server sends the status do the client
 for signal in 9 15 ; do
-  ssh -o StrictHostKeyChecking=no -p 10000 127.0.0.1 "kill -${signal} \$\$"
+  ssh -p 10000 127.0.0.1 "kill -${signal} \$\$"
   exitcode=$?
   if [ x"${exitcode}" != x255 ]; then
     echo "ssh 127.0.0.1:10000 "'"'"kill -${signal} "'$$"'" failed: tinyssd exited with exit code: ${exitcode}" >&2
-    exit 5
+    exit 4
   else
-    echo "ssh 127.0.0.1:10000 "'"'"kill -${signal} "'$$"'" works" >&2
+    echo "ssh 127.0.0.1:10000 "'"'"kill -${signal} "'$$"'" works"
   fi
 done
 
diff -pruN 20190101-1/debian/tests/04sftp 20220801-1/debian/tests/04sftp
--- 20190101-1/debian/tests/04sftp	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/tests/04sftp	2022-08-01 06:28:20.000000000 +0000
@@ -20,44 +20,55 @@ chmod 700 ~/.ssh
 # run tinysshd on port 10000
 rm -rf sshkeydir
 tinysshd-makekey -q sshkeydir
-tcpserver -HRDl0 127.0.0.1 10000 tinysshd -x sftp=/usr/lib/openssh/sftp-server -- sshkeydir &
+tcpserver -HRDl0 127.0.0.1 10000 tinysshd -x sftp=/usr/lib/openssh/sftp-server -- sshkeydir 2>tinysshd.log &
 tcpserverpid=$!
 
 cleanup() {
   ex=$?
-  rm -rf ~/.ssh sshkeydir ~/testfile1 testfile2
-  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   #kill tcpserver
   kill -TERM "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
   kill -KILL "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  if [ ${ex} -gt 0 ]; then
+    (
+      echo "sftp.log:"
+      cat sftp.log
+      echo "tinysshd.log:"
+      cat tinysshd.log
+    ) >&2
+  fi
+  rm -rf ~/.ssh sshkeydir ~/testfile1 testfile2 tinysshd.log sftp.log
+  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   exit "${ex}"
 }
 trap "cleanup" EXIT TERM INT
 
+# add server key to the known_hosts
+ssh-keyscan -H -p 10000 127.0.0.1 2>/dev/null > ~/.ssh/known_hosts
+
 echo ahoj >~/testfile1
 
 # tries login without authorization key
 # must fail
-sftp -o StrictHostKeyChecking=no -P 10000 127.0.0.1:testfile1 testfile2
+sftp -P 10000 127.0.0.1:testfile1 testfile2 >sftp.log 2>&1
 exitcode=$?
 if [ x"${exitcode}" = x0 ]; then
-  echo "sftp 127.0.0.1:10000 login without authorization key with exit status 0, too bad" >&2
-  exit 1
+  echo "sftp 127.0.0.1:10000 login without authorization key with exit status 0, too bad, sftp.log:" >&2
+  exit 2
 else
-  echo "sftp 127.0.0.1:10000 login without authorization key failed, this is ok" >&2
+  echo "sftp 127.0.0.1:10000 login without authorization key failed, this is ok"
 fi
 
 # create authorization keys
-ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 2
-cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 3
+ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 10
+cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 11
 
-sftp -o StrictHostKeyChecking=no -P 10000 127.0.0.1:testfile1 testfile2
+sftp -P 10000 127.0.0.1:testfile1 testfile2 >sftp.log 2>&1
 exitcode=$?
 if [ x"${exitcode}" = x0 ] && [ x"`cat ~/testfile1`" = x"`cat testfile2`" ]; then
-  echo "sftp 127.0.0.1:10000: ok" >&2
+  echo "sftp 127.0.0.1:10000: ok"
 else
-  echo "sftp 127.0.0.1:10000: failed" >&2
-  exit 2
+  echo "sftp 127.0.0.1:10000: failed, sftp.log:" >&2
+  exit 3
 fi
 
 exit 0
diff -pruN 20190101-1/debian/tests/05authorizedkeys 20220801-1/debian/tests/05authorizedkeys
--- 20190101-1/debian/tests/05authorizedkeys	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/tests/05authorizedkeys	2022-08-01 06:28:20.000000000 +0000
@@ -19,22 +19,33 @@ chmod 700 ~/.ssh
 # run tinysshd on port 10000
 rm -rf sshkeydir
 tinysshd-makekey -q sshkeydir
-tcpserver -HRDl0 127.0.0.1 10000 tinysshd -- sshkeydir &
+tcpserver -HRDl0 127.0.0.1 10000 tinysshd -- sshkeydir 2>tinysshd.log &
 tcpserverpid=$!
 
 cleanup() {
   ex=$?
-  rm -rf ~/.ssh sshkeydir
-  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   #kill tcpserver
   kill -TERM "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
   kill -KILL "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  if [ ${ex} -gt 0 ]; then
+    (
+      echo "homedir:"
+      ls -ld ~ ~/.ssh
+      echo "tinysshd.log:"
+      cat tinysshd.log
+    ) >&2
+  fi
+  rm -rf ~/.ssh sshkeydir tinysshd.log ssh.log
+  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   exit "${ex}"
 }
 trap "cleanup" EXIT TERM INT
 
 # create authorization keys
-ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 2
+ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 10
+
+# add server key to the known_hosts
+ssh-keyscan -H -p 10000 127.0.0.1 2>/dev/null > ~/.ssh/known_hosts
 
 KEYTYPE=`cut -d ' ' -f1 < ~/.ssh/id_ed25519.pub`
 KEY=`cut -d ' ' -f2 < ~/.ssh/id_ed25519.pub`
@@ -58,29 +69,30 @@ REST=`cut -d ' ' -f3- < ~/.ssh/id_ed2551
 ) > ~/.ssh/authorized_keys
 (
   echo "malformed authorization_keys:"
-  cat ~/.ssh/authorized_keys >&2
+  cat ~/.ssh/authorized_keys
   echo
-) >&2
+)
 
-ssh -o StrictHostKeyChecking=no -p 10000 127.0.0.1 'exit 0'
+ssh -p 10000 127.0.0.1 'exit 0' >ssh.log 2>&1
 exitcode=$?
 if [ "${exitcode}" -eq 0 ]; then
   echo "ssh 127.0.0.1:10000 login using malformed authorized_keys succeeded, too bad" >&2
+  cat ssh.log
   exit 3
 else
-  echo "ssh 127.0.0.1:10000 login using malformed authorized_keys failed, this is correct behavior" >&2
+  echo "ssh 127.0.0.1:10000 login using malformed authorized_keys failed, this is correct behavior"
 fi
 
 # now add correct line to authorized_keys
 echo "${KEYTYPE} ${KEY}" >> ~/.ssh/authorized_keys
 
-ssh -o StrictHostKeyChecking=no -p 10000 127.0.0.1 'exit 0'
+ssh -p 10000 127.0.0.1 'exit 0'
 exitcode=$?
 if [ ! "${exitcode}" -eq 0 ]; then
   echo "ssh 127.0.0.1:10000 login using correct authorized_keys failed, too bad" >&2
   exit 4
 else
-  echo "ssh 127.0.0.1:10000 login using correct authorized_keys succeeded, this is correct behavior" >&2
+  echo "ssh 127.0.0.1:10000 login using correct authorized_keys succeeded, this is correct behavior"
 fi
 
 exit 0
diff -pruN 20190101-1/debian/tests/06transfer 20220801-1/debian/tests/06transfer
--- 20190101-1/debian/tests/06transfer	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/tests/06transfer	2022-08-01 06:28:20.000000000 +0000
@@ -20,36 +20,45 @@ chmod 700 ~/.ssh
 # run tinysshd on port 10000
 rm -rf sshkeydir
 tinysshd-makekey -q sshkeydir
-tcpserver -HRDl0 127.0.0.1 10000 tinysshd -- sshkeydir &
+tcpserver -HRDl0 127.0.0.1 10000 tinysshd -- sshkeydir 2>tinysshd.log &
 tcpserverpid=$!
 
 cleanup() {
   ex=$?
-  rm -rf ~/.ssh sshkeydir testfile1 ~/testfile2 testfile3
-  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   #kill tcpserver
   kill -TERM "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
   kill -KILL "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  if [ ${ex} -gt 0 ]; then
+    (
+      echo "tinysshd.log:"
+      cat tinysshd.log
+    ) >&2
+  fi
+  rm -rf ~/.ssh sshkeydir testfile1 ~/testfile2 testfile3 tinysshd.log
+  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
   exit "${ex}"
 }
 trap "cleanup" EXIT TERM INT
 
 # create authorization keys
-ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 2
-cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 3
+ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 10
+cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 11
+
+# add server key to the known_hosts
+ssh-keyscan -H -p 10000 127.0.0.1 2>/dev/null > ~/.ssh/known_hosts
 
 # create random file
-dd if=/dev/urandom of=testfile1 bs=1 count=1048576
+dd if=/dev/urandom of=testfile1 bs=1 count=1048576 2>/dev/null
 
-# runs remote dd command and checks sha256 checksum
-ssh -o StrictHostKeyChecking=no -p 10000 127.0.0.1 "cat >testfile2" < testfile1
-ssh -o StrictHostKeyChecking=no -p 10000 127.0.0.1 "cat testfile2" > testfile3
+# run remote command and check the sha256 checksum
+ssh -p 10000 127.0.0.1 "cat >testfile2" < testfile1
+ssh -p 10000 127.0.0.1 "cat testfile2" > testfile3
 
 if [ x"`sha256sum < testfile1`" = x"`sha256sum < testfile3`" ]; then
-  echo "ssh transfer ok" >&2
+  echo "ssh transfer ok"
 else
   echo "ssh transfer failed" >&2
-  exit 1
+  exit 2
 fi
 
 exit 0
diff -pruN 20190101-1/debian/tests/07kex 20220801-1/debian/tests/07kex
--- 20190101-1/debian/tests/07kex	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/debian/tests/07kex	2022-08-01 06:28:20.000000000 +0000
@@ -0,0 +1,74 @@
+#!/bin/sh
+# 20210320
+# Jan Mojzis
+# Public domain.
+
+# change directory to $AUTOPKGTEST_TMP
+cd "${AUTOPKGTEST_TMP}"
+
+# we need tools from /usr/sbin
+PATH="/usr/sbin:${PATH}"
+export PATH
+
+# backup ~/.ssh
+rm -rf ~/.ssh.tinysshtest.bk
+[ -d ~/.ssh ] && mv ~/.ssh ~/.ssh.tinysshtest.bk
+mkdir -p ~/.ssh
+chmod 700 ~/.ssh
+
+# run tinysshd on port 10000
+rm -rf sshkeydir
+tinysshd-makekey -q sshkeydir
+tcpserver -HRDl0 127.0.0.1 10000 tinysshd -- sshkeydir 2>tinysshd.log &
+tcpserverpid=$!
+
+cleanup() {
+  ex=$?
+  #kill tcpserver
+  kill -TERM "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  kill -KILL "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  if [ ${ex} -gt 0 ]; then
+    (
+      echo "tinysshd.log:"
+      cat tinysshd.log
+    ) >&2
+  fi
+  rm -rf ~/.ssh sshkeydir testfile1 ~/testfile2 testfile3 tinysshd.log
+  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
+  exit "${ex}"
+}
+trap "cleanup" EXIT TERM INT
+
+# create authorization keys
+ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 10
+cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 11
+
+# add server key to the known_hosts
+ssh-keyscan -H -p 10000 127.0.0.1 2>/dev/null > ~/.ssh/known_hosts
+
+# get KEXs supported by openssh-client
+kexs=""
+for kex in curve25519-sha256 curve25519-sha256@libssh.org sntrup761x25519-sha512@openssh.com; do
+  if [ x"`ssh -o KexAlgorithms=${kex} 2>&1 | grep usage`" != x ]; then
+    kexs="${kexs} ${kex}"
+  fi
+done
+
+for kex in ${kexs}; do
+
+  # create random file
+  rm -f testfile1 testfile2 testfile3
+  dd if=/dev/urandom of=testfile1 bs=1 count=1048576 2>/dev/null
+
+  ssh -o "KexAlgorithms=${kex}" -p 10000 127.0.0.1 "cat >testfile2" < testfile1
+  ssh -o "KexAlgorithms=${kex}" -p 10000 127.0.0.1 "cat testfile2" > testfile3
+
+  if [ x"`sha256sum < testfile1`" = x"`sha256sum < testfile3`" ]; then
+    echo "ssh kex ${kex} ok"
+  else
+    echo "ssh kex ${kex} failed" >&2
+    exit 2
+  fi
+done
+
+exit 0
diff -pruN 20190101-1/debian/tests/08badauth 20220801-1/debian/tests/08badauth
--- 20190101-1/debian/tests/08badauth	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/debian/tests/08badauth	2022-08-01 06:28:20.000000000 +0000
@@ -0,0 +1,61 @@
+#!/bin/sh
+# 20210511
+# Jan Mojzis
+# Public domain.
+
+
+# change directory to $AUTOPKGTEST_TMP
+cd "${AUTOPKGTEST_TMP}"
+
+# we need tools from /usr/sbin
+PATH="/usr/sbin:${PATH}"
+export PATH
+
+# backup ~/.ssh
+rm -rf ~/.ssh.tinysshtest.bk
+[ -d ~/.ssh ] && mv ~/.ssh ~/.ssh.tinysshtest.bk
+mkdir -p ~/.ssh
+chmod 700 ~/.ssh
+
+# run tinysshd on port 10000
+rm -rf sshkeydir
+tinysshd-makekey -q sshkeydir
+tcpserver -HRDl0 127.0.0.1 10000 tinysshd -v -- sshkeydir 2>tinysshd.log &
+tcpserverpid=$!
+
+cleanup() {
+  ex=$?
+  echo
+  echo "tinysshd.log:"
+  cat tinysshd.log
+  rm -rf ~/.ssh sshkeydir tinysshd.log ssh.log
+  [ -d ~/.ssh.tinysshtest.bk ] && mv ~/.ssh.tinysshtest.bk ~/.ssh
+  #kill tcpserver
+  kill -TERM "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  kill -KILL "${tcpserverpid}" 1>/dev/null 2>/dev/null || :
+  exit "${ex}"
+}
+trap "cleanup" EXIT TERM INT
+
+# create authorization keys
+ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519 || exit 10
+cp -pr ~/.ssh/id_ed25519.pub ~/.ssh/authorized_keys || exit 11
+
+# add server key to the known_hosts
+ssh-keyscan -H -p 10000 127.0.0.1 2>/dev/null > ~/.ssh/known_hosts
+
+chmod 757 ~/.ssh
+if ssh -p 10000 127.0.0.1 true 2>ssh.log; then
+  echo "tinysshd doesn't reject login when ~/.ssh is other writable, BAD !!!" >&2
+else
+  echo "tinysshd rejects login when ~/.ssh is other writable"
+fi
+
+chmod 775 ~/.ssh
+if ssh -p 10000 127.0.0.1 true 2>ssh.log; then
+  echo "tinysshd doesn't reject login when ~/.ssh is group writable, BAD !!!" >&2
+else
+  echo "tinysshd rejects login when ~/.ssh is group writable"
+fi
+
+exit 0
diff -pruN 20190101-1/debian/tests/control 20220801-1/debian/tests/control
--- 20190101-1/debian/tests/control	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/tests/control	2022-08-01 06:28:20.000000000 +0000
@@ -1,23 +1,24 @@
 Tests: 01makekeyprintkey
 Depends: tinysshd
-Restrictions: allow-stderr
 
 Tests: 02handshake
-Depends: systemd-sysv, systemd, tinysshd, python3, ucspi-tcp
+Depends: python3, systemd, systemd-sysv, tinysshd, ucspi-tcp
 Restrictions: allow-stderr, needs-root, isolation-container
 
 Tests: 03exitcodes
-Depends: tinysshd, openssh-client, ucspi-tcp
-Restrictions: allow-stderr, needs-root
+Depends: openssh-client, tinysshd, ucspi-tcp
 
 Tests: 04sftp
-Depends: tinysshd, openssh-client, openssh-sftp-server, ucspi-tcp
-Restrictions: allow-stderr, needs-root
+Depends: openssh-client, openssh-sftp-server, tinysshd, ucspi-tcp
 
 Tests: 05authorizedkeys
-Depends: tinysshd, openssh-client, ucspi-tcp
-Restrictions: allow-stderr, needs-root
+Depends: openssh-client, tinysshd, ucspi-tcp
 
 Tests: 06transfer
-Depends: tinysshd, openssh-client, ucspi-tcp
-Restrictions: allow-stderr, needs-root
+Depends: openssh-client, tinysshd, ucspi-tcp
+
+Tests: 07kex
+Depends: openssh-client, tinysshd, ucspi-tcp
+
+Tests: 08badauth
+Depends: openssh-client, tinysshd, ucspi-tcp
diff -pruN 20190101-1/debian/tinysshd.default 20220801-1/debian/tinysshd.default
--- 20190101-1/debian/tinysshd.default	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/tinysshd.default	2022-08-01 06:28:20.000000000 +0000
@@ -1,8 +1,8 @@
 #-s ... enable  state-of-the-art crypto - ssh-ed25519, curve25519-sha256, chacha20-poly1305@openssh.com (default)
 #-S ... disable state-of-the-art crypto - ssh-ed25519, curve25519-sha256, chacha20-poly1305@openssh.com
 
-#-p ... enable  post-quantum crypto - sntrup4591761x25519-sha512@tinyssh.org, chacha20-poly1305@openssh.com (default)
-#-P ... disable post-quantum crypto - sntrup4591761x25519-sha512@tinyssh.org, chacha20-poly1305@openssh.com
+#-p ... enable  post-quantum crypto - sntrup761x25519-sha512@openssh.com, chacha20-poly1305@openssh.com (default)
+#-P ... disable post-quantum crypto - sntrup761x25519-sha512@openssh.com, chacha20-poly1305@openssh.com
 
 #-q ... enable quiet mode
 #-v ... enable verbose mode
diff -pruN 20190101-1/debian/tinysshd.links 20220801-1/debian/tinysshd.links
--- 20190101-1/debian/tinysshd.links	2019-01-02 05:01:58.000000000 +0000
+++ 20220801-1/debian/tinysshd.links	2022-08-01 06:28:20.000000000 +0000
@@ -1,2 +1,3 @@
 /usr/sbin/tinysshd /usr/sbin/tinysshd-makekey
 /usr/sbin/tinysshd /usr/sbin/tinysshd-printkey
+/usr/sbin/tinysshd /usr/sbin/tinysshnoneauthd
diff -pruN 20190101-1/debian/tinysshd.manpages 20220801-1/debian/tinysshd.manpages
--- 20190101-1/debian/tinysshd.manpages	2018-10-22 06:02:19.000000000 +0000
+++ 20220801-1/debian/tinysshd.manpages	2022-08-01 06:28:20.000000000 +0000
@@ -1,3 +1,4 @@
+build/man/tinysshd-makekey.8
+build/man/tinysshd-printkey.8
 build/man/tinysshd.8
-build/man/tinysshd-makekey.1
-build/man/tinysshd-printkey.1
+build/man/tinysshnoneauthd.8
diff -pruN 20190101-1/debian/watch 20220801-1/debian/watch
--- 20190101-1/debian/watch	2018-10-22 06:09:56.000000000 +0000
+++ 20220801-1/debian/watch	2022-08-01 06:28:20.000000000 +0000
@@ -1,4 +1,4 @@
 version=4
-opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/tinyssh-$1\.tar\.gz/,\
-pgpsigurlmangle=s/archive\/(\d\S+)\.tar\.gz/releases\/download\/$1\/$1\.tar\.gz\.asc/ \
-  https://github.com/janmojzis/tinyssh/releases .*/(\d\S+)\.tar\.gz
+opts=filenamemangle=s/.+\/(\d\S+)\.tar\.gz/tinyssh-$1\.tar\.gz/,\
+pgpsigurlmangle=s/archive\/.+\/(\d\S+)\.tar\.gz/releases\/download\/$1\/$1\.tar\.gz\.asc/ \
+  https://github.com/janmojzis/tinyssh/releases/latest .*/(\d\S+)\.tar\.gz
diff -pruN 20190101-1/Makefile 20220801-1/Makefile
--- 20190101-1/Makefile	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/Makefile	2022-07-17 07:30:14.000000000 +0000
@@ -1,5 +1,7 @@
 compile: make-tinyssh.sh
 	sh -e make-tinyssh.sh
+cross-compile: make-tinysshcc.sh
+	sh -e make-tinysshcc.sh
 clean:
 	rm -rf build
 install:
diff -pruN 20190101-1/make-install.sh 20220801-1/make-install.sh
--- 20190101-1/make-install.sh	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/make-install.sh	2022-07-17 07:30:14.000000000 +0000
@@ -1,36 +1,44 @@
-#!/bin/sh -e
+#!/bin/sh
+set -e
 
 build="`pwd`/build"
 source="`pwd`"
 bin="${build}/bin"
 man="${build}/man"
-installcmd="${bin}/_tinysshd-install"
 
 cat "${source}/tinyssh/TARGETS" |\
 while read x
 do
   [ -x "${bin}/${x}" ] || \
-    ( 
+    (
       echo "=== `date` === $x not compiled, compile first!"
-      exit 111; 
+      exit 111;
     ) || exit 111
 done || exit 111
 
-[ -x "${installcmd}" ] || \
-    ( 
-      echo "=== `date` === ${installcmd} not compiled, compile first!"
-      exit 111; 
-    ) || exit 111
-
 #bin
 confbin="`head -1 conf-bin`"
 bindir=`echo "$1/${confbin}" | sed 's,//,/,g'`
 echo "=== `date` === installing bin directory ${bindir}"
 mkdir -p "${bindir}" || exit 111
-cat "${source}/tinyssh/TARGETS" |\
-while read x
+cat "${source}/tinyssh/LINKS" |\
+while read x y
 do
-  "${installcmd}" "${bin}/${x}" "${bindir}" "${x}.tmp" "${x}" 1 || exit 111
+  rm -f "${x}.tmp"
+  if [ "_${y}" = "_" ]; then
+    cp "${bin}/${x}" "${bindir}/${x}.tmp"
+    (
+      cd "${bindir}"
+      chmod 755 "${x}.tmp"
+      mv -f "${x}.tmp" "${x}"
+    )
+  else
+    (
+      cd "${bindir}"
+      ln -s "${y}" "${x}.tmp"
+      mv -f "${x}.tmp" "${x}"
+    )
+  fi
   echo "=== `date` ===   installing ${bin}/${x} -> ${bindir}/${x}"
 done || exit 111
 echo "=== `date` === finishing"
@@ -45,7 +53,12 @@ while read x
 do
   n=`echo "${x}" | cut -d'.' -f2`
   mkdir -p "${mandir}/man${n}" || exit 111
-  "${installcmd}" "${man}/${x}" "${mandir}/man${n}" "${x}.tmp" "${x}" || exit 111
+  cp "${man}/${x}" "${mandir}/man${n}/${x}.tmp"
+  (
+    cd "${mandir}/man${n}"
+    chmod 644 "${x}.tmp"
+    mv -f "${x}.tmp" "${x}"
+  )
   echo "=== `date` ===   installing ${man}/${x} -> ${mandir}/man${n}/${x}"
 done || exit 111
 echo "=== `date` === finishing"
diff -pruN 20190101-1/make-tinysshcc.sh 20220801-1/make-tinysshcc.sh
--- 20190101-1/make-tinysshcc.sh	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/make-tinysshcc.sh	2022-07-17 07:30:14.000000000 +0000
@@ -69,6 +69,28 @@ mkdir -p "${work}"
 compiler=`head -1 "${work}/compiler"`
 log1 "finishing"
 
+log1 "obtaining ar"
+rm -rf "${work}"
+mkdir -p "${work}"
+(
+  cd "${work}"
+  (
+    if [ x"${AR}" != x ]; then
+      echo "${AR} "
+    fi
+    cat "${top}/conf-ar"
+  ) | while read ar
+  do
+    touch test.o
+    ${ar} cr test.a test.o || { log2 "${ar} failed"; continue; }
+    log2 "${ar} ok"
+    echo "${ar}" > ar
+    break
+  done
+)
+ar=`head -1 "${work}/ar"`
+log1 "finishing"
+
 log1 "checking compiler options"
 rm -rf "${work}"
 mkdir -p "${work}"
@@ -139,7 +161,7 @@ cp -pr sysdep/* "${work}"
     while read target source
     do
       [ -f "${include}/${target}" ] && continue
-      rm -f "${source}" "${target}.tmp" 
+      rm -f "${source}" "${target}.tmp"
       [ -f "${source}.out" ] || continue
       ${compiler} -O0 -o "${source}" "${source}.c" ${libs} || continue
       cp "${source}.out" "${include}/${target}"
@@ -158,15 +180,15 @@ cp -pr crypto/* "${work}"
   cat CRYPTOSOURCES\
   | while read x
   do
-    ${compiler} -I"${include}" -c "${x}.c" || { log2 "libtinynacl.a failed ... see the log ${log}"; exit 111; }
+    ${compiler} -I"${include}" -c "${x}.c" || { log2 "libtinysshcrypto.a failed ... see the log ${log}"; exit 111; }
   done || exit 111
-  ar cr "${lib}/libtinynacl.a" `cat CRYPTOLIBS` || exit 0
+  ${ar} cr "${lib}/libtinysshcrypto.a" `cat CRYPTOLIBS` || exit 0
 )
-log2 "libtinynacl.a ok"
+log2 "libtinysshcrypto.a ok"
 log1 "finishing"
 
-origlibs="${origlibs} ${lib}/libtinynacl.a"
-libs="${libs} ${lib}/libtinynacl.a"
+origlibs="${lib}/libtinysshcrypto.a ${origlibs}"
+libs="${lib}/libtinysshcrypto.a ${libs}"
 
 log1 "starting crypto headers"
 rm -rf "${work}"
@@ -199,7 +221,7 @@ cp -pr tinyssh/* "${work}"
     ${compiler} "-DCOMPILER=\"${compilerorig}\"" "-DVERSION=\"${version}\"" -I"${include}" -c "${x}.c" || { log2 "${x}.o failed ... see the log ${log}"; exit 111; }
     log2 "${x}.o ok"
   done || exit 111
-  ar cr libtinyssh.a `cat LIBS` || exit 111
+  ${ar} cr libtinyssh.a `cat LIBS` || exit 111
   log1 "finishing"
 
   log1 "starting tinyssh"
diff -pruN 20190101-1/make-tinyssh.sh 20220801-1/make-tinyssh.sh
--- 20190101-1/make-tinyssh.sh	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/make-tinyssh.sh	2022-07-17 07:30:14.000000000 +0000
@@ -120,7 +120,7 @@ if [ x"${LIBS}" != x ]; then
     for i in ${LIBS}; do
       echo 'int main(void) { return 0; }' > try.c
       ${compiler} ${i} -o try try.c || { log2 "${i} failed"; continue; }
-      syslibs="${i} ${syslibs}"
+      syslibs="${syslibs} ${i}"
       log2 "${i} ok"
     done
     echo ${syslibs} > syslibs
@@ -164,15 +164,15 @@ cp -pr crypto/* "${work}"
   cat CRYPTOSOURCES\
   | while read x
   do
-    ${compiler} -I"${include}" -c "${x}.c" || { log2 "libtinynacl.a failed ... see the log ${log}"; exit 111; }
+    ${compiler} -I"${include}" -c "${x}.c" || { log2 "libtinysshcrypto.a failed ... see the log ${log}"; exit 111; }
   done || exit 111
-  ar cr "${lib}/libtinynacl.a" `cat CRYPTOLIBS` || exit 0
+  ar cr "${lib}/libtinysshcrypto.a" `cat CRYPTOLIBS` || exit 0
 )
-log2 "libtinynacl.a ok"
+log2 "libtinysshcrypto.a ok"
 log1 "finishing"
 
-origlibs="${origlibs} ${lib}/libtinynacl.a"
-libs="${libs} ${lib}/libtinynacl.a"
+origlibs="${lib}/libtinysshcrypto.a ${origlibs}"
+libs="${lib}/libtinysshcrypto.a ${libs}"
 
 log1 "starting crypto headers"
 rm -rf "${work}"
diff -pruN 20190101-1/man/tinysshd.8 20220801-1/man/tinysshd.8
--- 20190101-1/man/tinysshd.8	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/man/tinysshd.8	2022-07-17 07:30:14.000000000 +0000
@@ -13,15 +13,15 @@ is a minimalistic SSH server which imple
 supports only secure cryptography (minimum 128\-bit security, protected against cache\-timing attacks)
 .sp
 .B tinysshd
-doesn't implement unnecessary features (such as SSH1 protocol, compression, ...)
-.sp
-.B tinysshd
 doesn't implement older crypto (such as RSA, DSA, HMAC\-MD5, HMAC\-SHA1, 3DES, RC4, ...)
 .sp
 .B tinysshd
 doesn't implement unsafe features (such as password or hostbased authentication)
 .sp
 .B tinysshd
+doesn't have features such: SSH1 protocol, compression, port forwarding, agent forwarding, X11 forwarding ...
+.sp
+.B tinysshd
 doesn't use dynamic memory allocation (no allocation failures, etc.)
 .SH OPTIONS
 .TP
@@ -35,13 +35,25 @@ print error messages (default)
 print extra information
 .TP
 .B \-s
-enable state\-of\-the\-art crypto \- ssh\-ed25519, curve25519\-sha256, chacha20\-poly1305@openssh.com (default)
+enable state\-of\-the\-art crypto (default)
+.sp
+signing \- ssh\-ed25519
+.sp
+key-exchange \- curve25519\-sha256
+.sp
+symmetric \- chacha20\-poly1305@openssh.com
 .TP
 .B \-S
 disable state\-of\-the\-art crypto
 .TP
 .B \-p
-enable post\-quantum crypto \- TODO, sntrup4591761x25519-sha512@tinyssh.org, chacha20\-poly1305@openssh.com (default)
+enable post\-quantum crypto (default)
+.sp
+signing \- TODO (not implemented yet)
+.sp
+key-exchange \- sntrup761x25519\-sha512@openssh.com
+.sp
+symmetric \-  chacha20\-poly1305@openssh.com
 .TP
 .B \-P
 disable post\-quantum crypto
@@ -55,6 +67,9 @@ don't use syslog, use standard error out
 .B \-x \fIname=command
 add subsystem command (e.g.: sftp=/usr/libexec/openssh/sftp\-server)
 .TP
+.B \-e \fIcommand
+execute the given command instead of spawning the shell (disables \fIexec\fR/\fIsubsystem\fR channel requests)
+.TP
 .I keydir
 directory containing TinySSH keys, typically /etc/tinyssh/sshkeydir
 .SH AUTHORIZATION
@@ -118,6 +133,7 @@ ExecStartPre=\-/usr/sbin/tinysshd\-makek
 EnvironmentFile=\-/etc/default/tinysshd
 ExecStart=/usr/sbin/tinysshd ${TINYSSHDOPTS} \-\- /etc/tinyssh/sshkeydir
 KillMode=process
+SuccessExitStatus=111
 StandardInput=socket
 StandardError=journal
 
@@ -127,8 +143,8 @@ WantedBy=multi\-user.target
 .RE
 .RE
 .SH SEE ALSO
-.BR tinysshd\-makekey (1),
-.BR tinysshd\-printkey (1)
+.BR tinysshd\-makekey (8),
+.BR tinysshd\-printkey (8)
 .sp
 .nf
 https://tinyssh.org/
diff -pruN 20190101-1/man/tinysshd-makekey.1 20220801-1/man/tinysshd-makekey.1
--- 20190101-1/man/tinysshd-makekey.1	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/man/tinysshd-makekey.1	1970-01-01 00:00:00.000000000 +0000
@@ -1,31 +0,0 @@
-.TH tinysshd\-makekey 1
-.SH NAME
-tinysshd\-makekey \- create TinySSH key\-directory
-.SH SYNOPSIS
-.B tinysshd\-makekey
-[ options ]
-.I keydir
-.SH DESCRIPTION
-.B tinysshd\-makekey
-safely creates secret\-keys and appropriate public\-keys in directory
-.I keydir
-.SH OPTIONS
-.TP
-.B \-q
-no error messages
-.TP
-.B \-Q
-print error messages (default)
-.TP
-.TP
-.I keydir
-directory for TinySSH keys, typically /etc/tinyssh/sshkeydir
-.SH EXAMPLE
-tinysshd\-makekey /etc/tinyssh/sshkeydir
-.SH SEE ALSO
-.BR tinysshd (8),
-.BR tinysshd\-printkey (1)
-.sp
-.nf
-https://tinyssh.org/
-.fi
diff -pruN 20190101-1/man/tinysshd-makekey.8 20220801-1/man/tinysshd-makekey.8
--- 20190101-1/man/tinysshd-makekey.8	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/man/tinysshd-makekey.8	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,31 @@
+.TH tinysshd\-makekey 8
+.SH NAME
+tinysshd\-makekey \- create TinySSH key\-directory
+.SH SYNOPSIS
+.B tinysshd\-makekey
+[ options ]
+.I keydir
+.SH DESCRIPTION
+.B tinysshd\-makekey
+safely creates secret\-keys and appropriate public\-keys in directory
+.I keydir
+.SH OPTIONS
+.TP
+.B \-q
+no error messages
+.TP
+.B \-Q
+print error messages (default)
+.TP
+.TP
+.I keydir
+directory for TinySSH keys, typically /etc/tinyssh/sshkeydir
+.SH EXAMPLE
+tinysshd\-makekey /etc/tinyssh/sshkeydir
+.SH SEE ALSO
+.BR tinysshd (8),
+.BR tinysshd\-printkey (8)
+.sp
+.nf
+https://tinyssh.org/
+.fi
diff -pruN 20190101-1/man/tinysshd-printkey.1 20220801-1/man/tinysshd-printkey.1
--- 20190101-1/man/tinysshd-printkey.1	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/man/tinysshd-printkey.1	1970-01-01 00:00:00.000000000 +0000
@@ -1,22 +0,0 @@
-.TH tinysshd\-printkey 1
-.SH NAME
-tinysshd\-printkey \- print TinySSH public\-keys
-.SH SYNOPSIS
-.B tinysshd\-printkey
-.I keydir
-.SH DESCRIPTION
-.B tinysshd\-printkey
-prints TinySSH public\-keys in base64 format
-.SH OPTIONS
-.TP
-.I keydir
-directory containing TinySSH keys, typically /etc/tinyssh/sshkeydir
-.SH EXAMPLE
-tinysshd\-printkey /etc/tinyssh/sshkeydir
-.SH SEE ALSO
-.BR tinysshd (8),
-.BR tinysshd\-makekey (1)
-.sp
-.nf
-https://tinyssh.org/
-.fi
diff -pruN 20190101-1/man/tinysshd-printkey.8 20220801-1/man/tinysshd-printkey.8
--- 20190101-1/man/tinysshd-printkey.8	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/man/tinysshd-printkey.8	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,22 @@
+.TH tinysshd\-printkey 8
+.SH NAME
+tinysshd\-printkey \- print TinySSH public\-keys
+.SH SYNOPSIS
+.B tinysshd\-printkey
+.I keydir
+.SH DESCRIPTION
+.B tinysshd\-printkey
+prints TinySSH public\-keys in base64 format
+.SH OPTIONS
+.TP
+.I keydir
+directory containing TinySSH keys, typically /etc/tinyssh/sshkeydir
+.SH EXAMPLE
+tinysshd\-printkey /etc/tinyssh/sshkeydir
+.SH SEE ALSO
+.BR tinysshd (8),
+.BR tinysshd\-makekey (8)
+.sp
+.nf
+https://tinyssh.org/
+.fi
diff -pruN 20190101-1/man/tinysshnoneauthd.8 20220801-1/man/tinysshnoneauthd.8
--- 20190101-1/man/tinysshnoneauthd.8	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/man/tinysshnoneauthd.8	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,51 @@
+.TH tinysshnoneauthd 8
+.SH NAME
+tinysshnoneauthd \- Tiny SSH daemon with 'none' auth. enabled
+.SH SYNOPSIS
+.B tinysshnoneauthd
+[ options ]
+.I keydir
+.SH DESCRIPTION
+.B tinysshnoneauthd
+creates encrypted (but not auhenticated) SSH connection.
+It's used to protect older protocols which uses e.g. telnet etc.
+.SH OPTIONS
+.TP
+.B \-q
+no error messages
+.TP
+.B \-Q
+print error messages (default)
+.TP
+.B \-v
+print extra information
+.TP
+.B \-l
+use syslog instead of standard error output (useful for running from inetd)
+.TP
+.B \-L
+don't use syslog, use standard error output (default)
+.TP
+.B \-e \fIcommand
+execute the given command instead of spawning the shell (disables \fIexec\fR/\fIsubsystem\fR channel requests)
+.TP
+.I keydir
+directory containing TinySSH keys, typically /etc/tinyssh/sshkeydir
+.SH EXAMPLES
+.TP
+.B TCPSERVER
+.nf
+useradd tinysshnoneauth
+mkdir -p /home/tinysshnoneauth/
+tinysshd-makekey /home/tinysshnoneauth/sshkeydir
+chown -R tinysshnoneauth /home/tinysshnoneauth/sshkeydir
+envuidgid tinysshnoneauth tcpserver -UHRDl0 0 2222 /usr/sbin/tinysshnoneauthd -vv -e 'cat /etc/motd' /home/tinysshnoneauth/sshkeydir
+.fi
+.SH SEE ALSO
+.BR tinysshd (8),
+.BR tinysshd\-makekey (8),
+.BR tinysshd\-printkey (8)
+.sp
+.nf
+https://tinyssh.org/
+.fi
diff -pruN 20190101-1/PROTOCOL.sntrup4591761x25519-sha512 20220801-1/PROTOCOL.sntrup4591761x25519-sha512
--- 20190101-1/PROTOCOL.sntrup4591761x25519-sha512	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/PROTOCOL.sntrup4591761x25519-sha512	1970-01-01 00:00:00.000000000 +0000
@@ -1,65 +0,0 @@
-This document describes the sntrup4591761x25519-sha512@tinyssh.org key-exchange
-method implemented in TinySSH. This key-exchange is intended to be secure
-against attacks using quantum computers. But also is intended to be at least
-as secure as elliptic-curve algorithms when postquantum part fails.
-
-New KEM key-exchange
-====================
-There are many postquantum public key encryption candidates (lattice based,
-code based, ...) and all of them can be converted to KEM (key encapsulation
-mechanism). E.g. NIST PQC competition uses KEM and appropriate crypto_kem
-API. KEM means that the sender takes a public key as input and produces
-a ciphertext and session key as output. And receiver takes a ciphertext
-and a secret key as input and produces session key as output.
-Therefore first step is modification of SSH protocol to allow KEM key-exchange:
-
-Client:
-- generate clients keypair using crypto_kem_keypair(client-pk, client-sk)
-- send client-pk to the server (in SSH_MSG_KEX_KEM_INIT message)
-
-Server:
-- generate ciphertext server-c and secret kem-k using crypto_kem_enc(server-c, kem-k, client-pk)
-- compute the exchange HASH using kem-k, derive keys, etc ...
-- send signed ciphertext server-c to the server (in SSH_MSG_KEX_KEM_REPLY message)
-
-Client:
-- compute secret kem-k using crypto_kem_dec(kem-k, server-c, client-sk)
-- compute the exchange HASH using kem-k, derive keys, etc ...
-
-For comparsion: ECDH Key Echange
-================================
-
-Client:
-- generate clients keypair using crypto_dh_keypair(client-pk, client-sk)
-- send client-pk to the server (in SSH_MSG_KEX_ECDH_INIT message)
-
-Server:
-- generate servers keypair using crypto_dh_keypair(server-pk, server-sk)
-- compute shared_secret using crypto_dh(shared_secret, client-pk, server-sk)
-- compute the exchange HASH using shared_secret, derive keys, etc ...
-- send signed publickey server-pk to the server (in SSH_MSG_KEX_ECDH_REPLY message)
-
-Client:
-- compute shared_secret using crypto_dh(shared_secret, server-pk, client-sk)
-- compute the exchange HASH using shared_secret, derive keys, etc ...
-
-Selected primitives
-====================
-sntrup4591761x25519-sha512@tinyssh.org is designed to use a post-quantum and
-elliptic-curve primitive concurrently. Security is not worst than
-e.g. in elliptic-curve-only curve25519-sha256, even if the post-quantum part
-is not secure.
-sntrup4591761x25519-sha512@tinyssh.org uses two primitives:
-- Latice based, Streamlined NTRU Prime 4591761
-- ECC X25519
-
-Streamlined NTRU Prime 4591761 https://ntruprime.cr.yp.to
----------------------------------------------------------
-- NTRU has a long history, NTRU Prime is reducing attack surface (prime-degree
-large-Galois-group inert-modulus)
-- constant-time implementation
-- short publickey, short ciphertext (~1kB)
-- submited to NIST PQC competition
-- internaly KEM use SHA512 -> no need to implement e.g. SHA3 (This is
-big benefit for TinySSH)
-
diff -pruN 20190101-1/README.md 20220801-1/README.md
--- 20190101-1/README.md	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/README.md	2022-07-17 07:30:14.000000000 +0000
@@ -1,2 +1,67 @@
-See https://tinyssh.org/
-[![TravisCI status](https://travis-ci.org/janmojzis/tinyssh.svg?branch=master)](https://travis-ci.org/janmojzis/tinyssh)
+### Introduction ###
+* tinysshd is a minimalistic SSH server which implements only a subset of SSHv2 features.
+* tinysshd supports only secure cryptography (minimum 128-bit security, protected against cache-timing attacks)
+* tinysshd doesn't implement older crypto (such as RSA, DSA, HMAC-MD5, HMAC-SHA1, 3DES, RC4, ...)
+* tinysshd doesn't implement unsafe features (such as password or hostbased authentication)
+* tinysshd doesn't have features such: SSH1 protocol, compression, port forwarding, agent forwarding, X11 forwarding ...
+* tinysshd doesn't use dynamic memory allocation (no allocation failures, etc.)
+
+### Crypto primitives ###
+* State-of-the-art crypto: ssh-ed25519, curve25519-sha256, chacha20-poly1305@openssh.com
+* Older standard: <strike>ecdsa-sha2-nistp256, ecdh-sha2-nistp256, aes256-ctr, hmac-sha2-256</strike> removed in version 20190101
+* Postquantum crypto: sntrup761x25519-sha512@openssh.com, chacha20-poly1305@openssh.com
+
+### Project timelime ###
+* <strike>experimental: 2014.01.01 - 2014.12.31 (experimentation)</strike>
+* <strike>alpha(updated): 2015.01.01 - 2017.12.31 (not ready for production use, ready for testing)</strike>
+* beta(updated): 2018.01.01 - ????.??.?? (ready for production use)
+* stable: expected ????.??.?? - (ready for production use - including post-quantum crypto)
+
+### Current release (20220305) ###
+* has 62633 words of code
+* beta release
+
+### How-to run ###
+~~~
+       TCPSERVER
+              tcpserver -HRDl0 0.0.0.0 22 /usr/sbin/tinysshd -v /etc/tinyssh/sshkeydir &
+
+       BUSYBOX
+              busybox tcpsvd 0 22 tinysshd -v /etc/tinyssh/sshkeydir &
+
+       INETD
+           /etc/inetd.conf:
+               ssh stream tcp nowait root /usr/sbin/tinysshd tinysshd -l -v /etc/tinyssh/sshkeydir
+
+       SYSTEMD
+           tinysshd.socket:
+               [Unit]
+               Description=TinySSH server socket
+               ConditionPathExists=!/etc/tinyssh/disable_tinysshd
+
+               [Socket]
+               ListenStream=22
+               Accept=yes
+
+               [Install]
+               WantedBy=sockets.target
+
+           tinysshd@.service:
+               [Unit]
+               Description=Tiny SSH server
+               After=network.target auditd.service
+
+               [Service]
+               ExecStartPre=-/usr/sbin/tinysshd-makekey -q /etc/tinyssh/sshkeydir
+               EnvironmentFile=-/etc/default/tinysshd
+               ExecStart=/usr/sbin/tinysshd ${TINYSSHDOPTS} -- /etc/tinyssh/sshkeydir
+               KillMode=process
+               SuccessExitStatus=111
+               StandardInput=socket
+               StandardError=journal
+
+               [Install]
+               WantedBy=multi-user.target
+~~~
+
+[![TravisCI status](https://travis-ci.com/janmojzis/tinyssh.svg?branch=master)](https://travis-ci.com/janmojzis/tinyssh)
diff -pruN 20190101-1/sysdep/hasutmpaddrv6.h-yes.c 20220801-1/sysdep/hasutmpaddrv6.h-yes.c
--- 20190101-1/sysdep/hasutmpaddrv6.h-yes.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/sysdep/hasutmpaddrv6.h-yes.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,11 @@
+/* Public domain. */
+#include <time.h>
+#include <sys/time.h>
+#include <utmp.h>
+
+int main(void) {
+
+    struct utmp ut;
+    int x[sizeof(ut.ut_addr_v6) < 16 ? -1 : 1] = {0};
+    return x[0];
+}
diff -pruN 20190101-1/sysdep/hasutmpaddrv6.h-yes.out 20220801-1/sysdep/hasutmpaddrv6.h-yes.out
--- 20190101-1/sysdep/hasutmpaddrv6.h-yes.out	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/sysdep/hasutmpaddrv6.h-yes.out	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1 @@
+#define HASUTMPADDRV6 1
diff -pruN 20190101-1/sysdep/hasutmpxaddrv6.h-yes.c 20220801-1/sysdep/hasutmpxaddrv6.h-yes.c
--- 20190101-1/sysdep/hasutmpxaddrv6.h-yes.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/sysdep/hasutmpxaddrv6.h-yes.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,11 @@
+/* Public domain. */
+#include <time.h>
+#include <sys/time.h>
+#include <utmpx.h>
+
+int main(void) {
+
+    struct utmpx utx;
+    int x[sizeof(utx.ut_addr_v6) < 16 ? -1 : 1] = {0};
+    return x[0];
+}
diff -pruN 20190101-1/sysdep/hasutmpxaddrv6.h-yes.out 20220801-1/sysdep/hasutmpxaddrv6.h-yes.out
--- 20190101-1/sysdep/hasutmpxaddrv6.h-yes.out	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/sysdep/hasutmpxaddrv6.h-yes.out	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1 @@
+#define HASUTMPXADDRV6 1
diff -pruN 20190101-1/sysdep/list 20220801-1/sysdep/list
--- 20190101-1/sysdep/list	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/sysdep/list	2022-07-17 07:30:14.000000000 +0000
@@ -27,6 +27,8 @@ echo 'hasutmpxupdwtmpx.h hasutmpxupdwtmp
 echo 'hasutmpxupdwtmpx.h default.h-no'
 echo 'hasutmpxsyslen.h hasutmpxsyslen.h-yes'
 echo 'hasutmpxsyslen.h default.h-no'
+echo 'hasutmpxaddrv6.h hasutmpxaddrv6.h-yes'
+echo 'hasutmpxaddrv6.h default.h-no'
 
 #utmp
 echo 'hasutmp.h hasutmp.h-yes'
@@ -49,6 +51,8 @@ echo 'hasutmplogwtmp.h hasutmplogwtmp.h-
 echo 'hasutmplogwtmp.h default.h-no'
 echo 'hasutmploginlogout.h hasutmploginlogout.h-yes'
 echo 'hasutmploginlogout.h default.h-no'
+echo 'hasutmpaddrv6.h hasutmpaddrv6.h-yes'
+echo 'hasutmpaddrv6.h default.h-no'
 
 #limits
 echo 'haslimits.h haslimits.h-yes'
diff -pruN 20190101-1/tinyssh/channel.c 20220801-1/tinyssh/channel.c
--- 20190101-1/tinyssh/channel.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/channel.c	2022-07-17 07:30:14.000000000 +0000
@@ -54,8 +54,8 @@ int channel_open(const char *user, crypt
     if (!localwindow) bug_inval();
     if (!maxpacket) bug_inval();
     if (!remotewindow) bug_inval();
-    if (channel.maxpacket != 0) bug_proto();
-    if (channel.pid != 0) bug_proto();
+    if (channel.maxpacket != 0) return 0;
+    if (channel.pid != 0) return 0;
 
     /* copy user-name */
     if (!str_copyn(channel.user, sizeof channel.user, user)) bug_nomem();
diff -pruN 20190101-1/tinyssh/getln.c 20220801-1/tinyssh/getln.c
--- 20190101-1/tinyssh/getln.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/getln.c	2022-07-17 07:30:14.000000000 +0000
@@ -48,7 +48,7 @@ int getln(int fd, void *xv, long long xm
     for (;;) {
         if (xlen >= xmax - 1) { x[xmax - 1] = 0; errno = ENOMEM; return -1; }
         r = getch(fd, &ch);
-        if (r != 1) { close(fd); fd = -1; break; }
+        if (r != 1) break;
         if (ch == 0) ch = '\n';
         x[xlen++] = ch;
         if (ch == '\n') break;
diff -pruN 20190101-1/tinyssh/LIBS 20220801-1/tinyssh/LIBS
--- 20190101-1/tinyssh/LIBS	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/LIBS	2022-07-17 07:30:14.000000000 +0000
@@ -50,7 +50,7 @@ sshcrypto_cipher.o
 sshcrypto_cipher_chachapoly.o
 sshcrypto_kex.o
 sshcrypto_kex_curve25519.o
-sshcrypto_kex_sntrup4591761x25519.o
+sshcrypto_kex_sntrup761x25519.o
 sshcrypto_key.o
 sshcrypto_key_ed25519.o
 str.o
diff -pruN 20190101-1/tinyssh/LINKS 20220801-1/tinyssh/LINKS
--- 20190101-1/tinyssh/LINKS	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/tinyssh/LINKS	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,3 @@
+tinysshd
+tinysshd-makekey tinysshd
+tinysshd-printkey tinysshd
diff -pruN 20190101-1/tinyssh/logsys.c 20220801-1/tinyssh/logsys.c
--- 20190101-1/tinyssh/logsys.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/logsys.c	2022-07-17 07:30:14.000000000 +0000
@@ -23,6 +23,7 @@ SunOS 5.11
 #include <time.h>
 #include <sys/time.h>
 #include <paths.h>
+#include <arpa/inet.h>
 
 #include "hasutilh.h"
 #ifdef HASUTILH
@@ -35,6 +36,7 @@ SunOS 5.11
 #endif
 #include "hasutmpxupdwtmpx.h"
 #include "hasutmpxsyslen.h"
+#include "hasutmpxaddrv6.h"
 
 #include "hasutmp.h"
 #ifdef HASUTMP
@@ -49,6 +51,7 @@ SunOS 5.11
 #include "hasutmpuser.h"
 #include "hasutmplogwtmp.h"
 #include "hasutmploginlogout.h"
+#include "hasutmpaddrv6.h"
 
 #include "str.h"
 #include "byte.h"
@@ -69,15 +72,25 @@ static void logsys_utmpx(const char *use
     str_copyn(ut.ut_line, sizeof ut.ut_line, name);
 
     /* host */
-    str_copyn(ut.ut_host, sizeof ut.ut_host, host);
+    if (flaglogin)
+      str_copyn(ut.ut_host, sizeof ut.ut_host, host);
+    else
+      byte_zero(ut.ut_host, sizeof ut.ut_host);
 #ifdef HASUTMPXSYSLEN
     ut.ut_syslen = str_len(ut.ut_host) + 1;
 #endif
 
+#ifdef HASUTMPXADDRV6
+    if (inet_pton(AF_INET6, ut.ut_host, &ut.ut_addr_v6) <= 0)
+      inet_pton(AF_INET, ut.ut_host, &ut.ut_addr_v6[0]) ;
+#endif
+
     /* user */
-    str_copyn(ut.ut_user, sizeof ut.ut_user, user);
+    if (flaglogin)
+      str_copyn(ut.ut_user, sizeof ut.ut_user, user);
+    else
+      byte_zero(ut.ut_user, sizeof ut.ut_user);
 
-    /* time */
     gettimeofday(&tv, 0);
     ut.ut_tv.tv_sec = tv.tv_sec;
     ut.ut_tv.tv_usec = tv.tv_usec;
@@ -96,8 +109,12 @@ static void logsys_utmpx(const char *use
     endutxent();
 
     /* update wtmpx */
-#if defined(_PATH_WTMPX) && defined(HASUTMPXUPDWTMPX)
+#ifdef HASUTMPXUPDWTMPX
+#if defined(_PATH_WTMPX)
     updwtmpx(_PATH_WTMPX, &ut);
+#elif defined (WTMPX_FILE)
+    updwtmpx(WTMPX_FILE, &ut);
+#endif
 #endif
 
 #endif
@@ -120,6 +137,10 @@ static void logsys_utmp(const char *user
     /* host */
 #ifdef HASUTMPHOST
     str_copyn(ut.ut_host, sizeof ut.ut_host, host);
+# ifdef HASUTMPADDRV6
+    if (inet_pton(AF_INET6, ut.ut_host, &ut.ut_addr_v6) <= 0)
+      inet_pton(AF_INET, ut.ut_host, &ut.ut_addr_v6[0]) ;
+# endif
 #endif
 
     /* user */
diff -pruN 20190101-1/tinyssh/main.h 20220801-1/tinyssh/main.h
--- 20190101-1/tinyssh/main.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/main.h	2022-07-17 07:30:14.000000000 +0000
@@ -1,7 +1,7 @@
 #ifndef _MAIN_H____
 #define _MAIN_H____
 
-extern int main_tinysshd(int, char **);
+extern int main_tinysshd(int, char **, const char *);
 extern int main_tinysshd_printkey(int, char **);
 extern int main_tinysshd_makekey(int, char **);
 
diff -pruN 20190101-1/tinyssh/main_tinysshd.c 20220801-1/tinyssh/main_tinysshd.c
--- 20190101-1/tinyssh/main_tinysshd.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/main_tinysshd.c	2022-07-17 07:30:14.000000000 +0000
@@ -25,14 +25,15 @@ Public domain.
 #include "global.h"
 #include "connectioninfo.h"
 #include "die.h"
+#include "str.h"
 #include "main.h"
 
-#define USAGE "usage: tinysshd [options] keydir"
-
 static unsigned int cryptotypeselected = sshcrypto_TYPENEWCRYPTO | sshcrypto_TYPEPQCRYPTO;
 static int flagverbose = 1;
 static int fdwd;
 static int flaglogger = 0;
+static const char *customcmd = 0;
+static int flagnoneauth = 0;
 
 static struct buf b1 = {global_bspace1, 0, sizeof global_bspace1};
 static struct buf b2 = {global_bspace2, 0, sizeof global_bspace2};
@@ -49,8 +50,7 @@ static void trigger(int x) {
     x = write(selfpipe[1], "", 1);
 }
 
-
-int main_tinysshd(int argc, char **argv) {
+int main_tinysshd(int argc, char **argv, const char *binaryname) {
 
     char *x;
     const char *keydir = 0;
@@ -64,14 +64,22 @@ int main_tinysshd(int argc, char **argv)
     struct pollfd *watchfromchild2;
     struct pollfd *watchselfpipe;
     int exitsignal, exitcode;
+    long long binarynamelen = str_len(binaryname);
+    const char *usage;
 
     signal(SIGPIPE, SIG_IGN);
     signal(SIGALRM, timeout);
 
-    log_init(0, "tinysshd", 0, 0);
+    log_init(0, binaryname, 0, 0);
+    if (str_equaln(binaryname, binarynamelen, "tinysshnoneauthd")) {
+        usage = "usage: tinysshnoneauthd [options] keydir";
+    }
+    else {
+        usage = "usage: tinysshd [options] keydir";
+    }
 
-    if (argc < 2) die_usage(USAGE);
-    if (!argv[0]) die_usage(USAGE);
+    if (argc < 2) die_usage(usage);
+    if (!argv[0]) die_usage(usage);
     for (;;) {
         if (!argv[1]) break;
         if (argv[1][0] != '-') break;
@@ -94,13 +102,23 @@ int main_tinysshd(int argc, char **argv)
                 if (x[1]) { channel_subsystem_add(x + 1); break; }
                 if (argv[1]) { channel_subsystem_add(*++argv); break; }
             }
+            if (*x == 'e') {
+                if (x[1]) { customcmd = x + 1; break; }
+                if (argv[1]) { customcmd = *++argv; break; }
+            }
 
-            die_usage(USAGE);
+            die_usage(usage);
         }
     }
-    keydir = *++argv; if (!keydir) die_usage(USAGE);
+    keydir = *++argv; if (!keydir) die_usage(usage);
+
+    log_init(flagverbose, binaryname, 1, flaglogger);
 
-    log_init(flagverbose, "tinysshd", 1, flaglogger);
+    if (str_equaln(binaryname, binarynamelen, "tinysshnoneauthd")) {
+        if (!customcmd) die_fatal("rejecting to run without -e customprogram", 0, 0);
+        if (geteuid() == 0) die_fatal("rejecting to run under UID=0", 0, 0);
+        flagnoneauth = 1;
+    }
 
     connectioninfo(channel.localip, channel.localport, channel.remoteip, channel.remoteport);
     log_i4("connection from ", channel.remoteip, ":", channel.remoteport);
@@ -157,7 +175,7 @@ rekeying:
     }
 
     /* send and receive kexdh */
-    if (!packet_kexdh(keydir, &b1, &b2)) die_fatal("unable to subprocess kexdh", 0, 0);
+    if (!packet_kexdh(keydir, &b1, &b2)) die_fatal("unable to process kexdh", 0, 0);
 
     if (packet.flagkeys) log_d1("rekeying: done");
     packet.flagkeys = 1;
@@ -166,7 +184,7 @@ rekeying:
 
     /* authentication + authorization */
     if (packet.flagauthorized == 0) {
-        if (!packet_auth(&b1, &b2)) die_fatal("authentication failed", 0, 0);
+        if (!packet_auth(&b1, &b2, flagnoneauth)) die_fatal("authentication failed", 0, 0);
         packet.flagauthorized = 1;
     }
 
@@ -259,7 +277,7 @@ rekeying:
                     if (!packet_channel_open(&b1, &b2)) die_fatal("unable to open channel", 0, 0);
                     break;
                 case SSH_MSG_CHANNEL_REQUEST:
-                    if (!packet_channel_request(&b1, &b2)) die_fatal("unable to handle channel-request", 0, 0);
+                    if (!packet_channel_request(&b1, &b2, customcmd)) die_fatal("unable to handle channel-request", 0, 0);
                     break;
                 case SSH_MSG_CHANNEL_DATA:
                     if (!packet_channel_recv_data(&b1)) die_fatal("unable to handle channel-data", 0, 0);
diff -pruN 20190101-1/tinyssh/packet_auth.c 20220801-1/tinyssh/packet_auth.c
--- 20190101-1/tinyssh/packet_auth.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/packet_auth.c	2022-07-17 07:30:14.000000000 +0000
@@ -4,6 +4,7 @@ Jan Mojzis
 Public domain.
 */
 
+#include <pwd.h>
 #include "buf.h"
 #include "ssh.h"
 #include "e.h"
@@ -16,7 +17,8 @@ Public domain.
 #include "log.h"
 #include "packet.h"
 
-int packet_auth(struct buf *b, struct buf *b2) {
+
+int packet_auth(struct buf *b, struct buf *b2, int flagnoneauth) {
 
     crypto_uint8 ch, flagsignature;
     long long pos, i, count, sign_bytes = 0;
@@ -35,7 +37,7 @@ int packet_auth(struct buf *b, struct bu
 
     /* parse "ssh-userauth" */
     pos = 0;
-    if (!packet_getall(b, SSH_MSG_SERVICE_REQUEST)) bug();
+    if (!packet_getall(b, SSH_MSG_SERVICE_REQUEST)) return 0;
     pos = packetparser_uint8(b->buf, b->len, pos, &ch);       /* SSH_MSG_SERVICE_REQUEST */
     if (ch != SSH_MSG_SERVICE_REQUEST) bug_proto();
     pos = packetparser_uint32(b->buf, b->len, pos, &len);     /* "ssh-userauth" */
@@ -46,7 +48,7 @@ int packet_auth(struct buf *b, struct bu
     /* send service accept */
     b->buf[0] = SSH_MSG_SERVICE_ACCEPT;
     packet_put(b);
-    if (!packet_sendall()) bug();
+    if (!packet_sendall()) return 0;
 
 
     for (count = 0; count < 32; ++count) {
@@ -54,7 +56,7 @@ int packet_auth(struct buf *b, struct bu
         pkname = "unknown";
         pos = 0;
         buf_purge(b);
-        if (!packet_getall(b, SSH_MSG_USERAUTH_REQUEST)) bug();
+        if (!packet_getall(b, SSH_MSG_USERAUTH_REQUEST)) return 0;
         pos = packetparser_uint8(b->buf, b->len, pos, &ch);         /* SSH_MSG_USERAUTH_REQUEST */
         if (ch != SSH_MSG_USERAUTH_REQUEST) bug_proto();
         pos = packetparser_uint32(b->buf, b->len, pos, &len);       /* name */
@@ -68,7 +70,20 @@ int packet_auth(struct buf *b, struct bu
         pos = packetparser_uint32(b->buf, b->len, pos, &len);       /* publickey/password/hostbased/none */
         pos = packetparser_skip(b->buf, b->len, pos, len);
 
-        if (str_equaln((char *)b->buf + pos - len, len, "none")) pkname = "none";
+        if (str_equaln((char *)b->buf + pos - len, len, "none")) {
+            /*
+            if auth. none is enabled get the user from UID
+            */
+            if (flagnoneauth) {
+                struct passwd *pw;
+                pkname = "none";
+                pw = getpwuid(geteuid());
+                if (!pw) bug();
+                str_copyn(packet.name, sizeof packet.name, pw->pw_name);
+                b->len = 0; b->buf[0] = 0;
+                goto authorized;
+            }
+        }
         if (str_equaln((char *)b->buf + pos - len, len, "password")) pkname = "password";
         if (str_equaln((char *)b->buf + pos - len, len, "hostbased")) pkname = "hostbased";
         if (str_equaln((char *)b->buf + pos - len, len, "publickey")) {
@@ -104,7 +119,7 @@ int packet_auth(struct buf *b, struct bu
                     buf_putstring(b, pkname);
                     putsignpk(b, pk);
                     packet_put(b);
-                    if (!packet_sendall()) bug();
+                    if (!packet_sendall()) return 0;
                     continue;
                 }
 
@@ -144,7 +159,7 @@ int packet_auth(struct buf *b, struct bu
         buf_putstring(b,"publickey");
         buf_putnum8(b, 0);
         packet_put(b);
-        if (!packet_sendall()) bug();
+        if (!packet_sendall()) return 0;
     }
     log_w1("auth: too many authentication tries");
     return 0;
@@ -155,9 +170,8 @@ authorized:
     log_i7("auth: ", packet.name, ": ", pkname, " ", (char *)b->buf, " accepted");
     buf_purge(b);
     buf_putnum8(b, SSH_MSG_USERAUTH_SUCCESS);
-    buf_putstring(b,"ssh-connection");
     packet_put(b);
-    if (!packet_sendall()) bug();
+    if (!packet_sendall()) return 0;
 
     purge(pk, sizeof pk);
     purge(sig, sizeof sig);
diff -pruN 20190101-1/tinyssh/packet_channel_open.c 20220801-1/tinyssh/packet_channel_open.c
--- 20190101-1/tinyssh/packet_channel_open.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/packet_channel_open.c	2022-07-17 07:30:14.000000000 +0000
@@ -49,7 +49,12 @@ int packet_channel_open(struct buf *b1,
             buf_putnum32(b2, id);                                   /* uint32    recipient channel */
             buf_putnum32(b2, id);                                   /* uint32    sender channel */
             buf_putnum32(b2, localwindow);                          /* uint32    initial window size */
-            buf_putnum32(b2, PACKET_LIMIT);                         /* uint32    maximum packet size */
+            /*
+            XXX
+            use PACKET_LIMIT/2 as maximum packet size,
+            workaround for miscalculated packet_length
+            */
+            buf_putnum32(b2, PACKET_LIMIT / 2);                     /* uint32    maximum packet size */
             packet_put(b2);
             buf_purge(b2);
             return 1;
diff -pruN 20190101-1/tinyssh/packet_channel_request.c 20220801-1/tinyssh/packet_channel_request.c
--- 20190101-1/tinyssh/packet_channel_request.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/packet_channel_request.c	2022-07-17 07:30:14.000000000 +0000
@@ -13,7 +13,7 @@ Public domain.
 #include "packetparser.h"
 #include "packet.h"
 
-int packet_channel_request(struct buf *b1, struct buf *b2) {
+int packet_channel_request(struct buf *b1, struct buf *b2, const char *customcmd) {
 
     long long pos = 0;
     crypto_uint8 ch, wantreply;
@@ -48,6 +48,11 @@ int packet_channel_request(struct buf *b
         buf_putnum8(b1, 0);
         p1[plen1] = 0;
 
+        if (customcmd) {
+            log_d4("packet=SSH_MSG_CHANNEL_REQUEST, exec ", p1, ", rejected: custom program is selected using param. -e ", customcmd);
+            goto reject;
+        }
+
         if (!channel_exec(p1)) bug();
         log_d3("packet=SSH_MSG_CHANNEL_REQUEST, exec ", p1, ", accepted");
         goto accept;
@@ -68,6 +73,11 @@ int packet_channel_request(struct buf *b
         buf_putnum8(b1, 0);
         p1[plen1] = 0;
 
+        if (customcmd) {
+            log_d4("packet=SSH_MSG_CHANNEL_REQUEST, subsystem ", p1, ", rejected: custom program is selected using param. -e ", customcmd);
+            goto reject;
+        }
+
         p2 = channel_subsystem_get(p1);
         if (!p2) {
             log_d3("packet=SSH_MSG_CHANNEL_REQUEST, subsystem ", p1, ", rejected");
@@ -90,8 +100,14 @@ int packet_channel_request(struct buf *b
 
         pos = packetparser_end(b1->buf, b1->len, pos);
 
-        if (!channel_exec(0)) bug();
-        log_d1("packet=SSH_MSG_CHANNEL_REQUEST, shell, accepted");
+        if (customcmd) {
+            if (!channel_exec(customcmd)) bug();
+            log_d3("packet=SSH_MSG_CHANNEL_REQUEST, shell, accepted, executing custom shell '", customcmd, "'");
+        } 
+        else {
+            if (!channel_exec(0)) bug();
+            log_d1("packet=SSH_MSG_CHANNEL_REQUEST, shell, accepted");
+        }
         goto accept;
     }
 
diff -pruN 20190101-1/tinyssh/packet_channel_send.c 20220801-1/tinyssh/packet_channel_send.c
--- 20190101-1/tinyssh/packet_channel_send.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/packet_channel_send.c	2022-07-17 07:30:14.000000000 +0000
@@ -15,12 +15,19 @@ Public domain.
 void packet_channel_send_data(struct buf *b) {
 
     long long r;
+    long long limit = PACKET_LIMIT;
+
+    if (channel.maxpacket > 0) {
+        if (channel.maxpacket < PACKET_LIMIT) {
+            limit = channel.maxpacket;
+        }
+    }
 
     buf_purge(b);
 
     if (b->alloc <= PACKET_LIMIT) bug_nomem();
     if (!packet_putisready()) return;
-    r = channel_read(b->buf + 9, PACKET_LIMIT - 9);
+    r = channel_read(b->buf + 9, limit - 9);
     if (r == 0) return;
     b->len = r + 9;
     b->buf[0] = SSH_MSG_CHANNEL_DATA;                   /* byte      SSH_MSG_CHANNEL_DATA */
@@ -34,12 +41,19 @@ void packet_channel_send_data(struct buf
 void packet_channel_send_extendeddata(struct buf *b) {
 
     long long r;
+    long long limit = PACKET_LIMIT;
+
+    if (channel.maxpacket > 0) {
+        if (channel.maxpacket < PACKET_LIMIT) {
+            limit = channel.maxpacket;
+        }
+    }
 
     buf_purge(b);
 
     if (b->alloc <= PACKET_LIMIT) bug_nomem();
     if (!packet_putisready()) return;
-    r = channel_extendedread(b->buf + 13, PACKET_LIMIT - 13);
+    r = channel_extendedread(b->buf + 13, limit - 13);
     if (r == 0) return;
     b->len = r + 13;
     b->buf[0] = SSH_MSG_CHANNEL_EXTENDED_DATA;          /* byte      SSH_MSG_CHANNEL_EXTENDED_DATA */
diff -pruN 20190101-1/tinyssh/packet.h 20220801-1/tinyssh/packet.h
--- 20190101-1/tinyssh/packet.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/packet.h	2022-07-17 07:30:14.000000000 +0000
@@ -104,13 +104,13 @@ extern int packet_kex_receive(void);
 extern int packet_kexdh(const char *, struct buf *, struct buf *);
 
 /* packet_auth.c */
-extern int packet_auth(struct buf *, struct buf *);
+extern int packet_auth(struct buf *, struct buf *, int);
 
 /* packet_channel_open.c */
 extern int packet_channel_open(struct buf *, struct buf *);
 
 /* packet_channel_request.c */
-extern int packet_channel_request(struct buf *, struct buf *);
+extern int packet_channel_request(struct buf *, struct buf *, const char *);
 
 /* packet_channel_recv.c */
 extern int packet_channel_recv_data(struct buf *);
diff -pruN 20190101-1/tinyssh/packet_kexdh.c 20220801-1/tinyssh/packet_kexdh.c
--- 20190101-1/tinyssh/packet_kexdh.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/packet_kexdh.c	2022-07-17 07:30:14.000000000 +0000
@@ -33,11 +33,11 @@ int packet_kexdh(const char *keydir, str
 
     if (packet.kex_packet_follows && !packet.kex_guess) {
         buf_purge(b1);
-        if (!packet_getall(b1, SSH_MSG_KEXDH_INIT)) bug_proto();
+        if (!packet_getall(b1, SSH_MSG_KEXDH_INIT)) return 0;
     }
 
     buf_purge(b1);
-    if (!packet_getall(b1, SSH_MSG_KEXDH_INIT)) bug_proto();
+    if (!packet_getall(b1, SSH_MSG_KEXDH_INIT)) return 0;
     pos = packetparser_uint8(b1->buf, b1->len, pos, &ch);           /* byte      SSH_MSG_KEXDH_INIT */
     if (ch != SSH_MSG_KEXDH_INIT) bug_proto();
     pos = packetparser_uint32(b1->buf, b1->len, pos, &len);         /* string    client's public key */
@@ -69,7 +69,7 @@ int packet_kexdh(const char *keydir, str
     packet.flagrekeying = 1;
 
     /* signature */
-    if (subprocess_sign(sm, sshcrypto_sign_bytes, keydir, hash, sshcrypto_hash_bytes) != 0) bug();
+    if (subprocess_sign(sm, sshcrypto_sign_bytes, keydir, hash, sshcrypto_hash_bytes) != 0) return 0;
     buf_purge(b1); buf_purge(b2);
 
     /* send server kex_ecdh_reply */
@@ -83,12 +83,12 @@ int packet_kexdh(const char *keydir, str
     buf_purge(b2);
     buf_putnum8(b2, SSH_MSG_NEWKEYS);
     packet_put(b2);
-    if (!packet_sendall()) bug();
+    if (!packet_sendall()) return 0;
 
     /* receive new keys */
     do {
         buf_purge(b2);
-        if (!packet_getall(b2, 0)) bug();
+        if (!packet_getall(b2, 0)) return 0;
     } while (b2->buf[0] != SSH_MSG_NEWKEYS);
 
     /* key derivation */
diff -pruN 20190101-1/tinyssh/SOURCES 20220801-1/tinyssh/SOURCES
--- 20190101-1/tinyssh/SOURCES	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/SOURCES	2022-07-17 07:30:14.000000000 +0000
@@ -50,7 +50,7 @@ sshcrypto_cipher
 sshcrypto_cipher_chachapoly
 sshcrypto_kex
 sshcrypto_kex_curve25519
-sshcrypto_kex_sntrup4591761x25519
+sshcrypto_kex_sntrup761x25519
 sshcrypto_key
 sshcrypto_key_ed25519
 str
diff -pruN 20190101-1/tinyssh/sshcrypto.h 20220801-1/tinyssh/sshcrypto.h
--- 20190101-1/tinyssh/sshcrypto.h	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/sshcrypto.h	2022-07-17 07:30:14.000000000 +0000
@@ -10,9 +10,9 @@
 #define sshcrypto_TYPEPQCRYPTO  0x4 /* TODO, TODO, chacha20-poly1305@openssh.com */
 
 /* kex - kem + hash */
-#define sshcrypto_kem_PUBLICKEYMAX  crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES
-#define sshcrypto_kem_CIPHERTEXTMAX crypto_kem_sntrup4591761x25519_CIPHERTEXTBYTES
-#define sshcrypto_kem_MAX           crypto_kem_sntrup4591761x25519_BYTES
+#define sshcrypto_kem_PUBLICKEYMAX  crypto_kem_sntrup761x25519_PUBLICKEYBYTES
+#define sshcrypto_kem_CIPHERTEXTMAX crypto_kem_sntrup761x25519_CIPHERTEXTBYTES
+#define sshcrypto_kem_MAX           crypto_kem_sntrup761x25519_BYTES
 #define sshcrypto_hash_MAX          crypto_hash_sha512_BYTES
 
 struct sshcrypto_kex {
@@ -47,9 +47,9 @@ extern int curve25519_enc(unsigned char
 extern void curve25519_putkemkey(struct buf *, const unsigned char *);
 #endif
 
-#if defined(crypto_kem_sntrup4591761x25519_BYTES) && defined(crypto_hash_sha512_BYTES)
-/* sshcrypto_kex_sntrup4591761x25519.c */
-extern void sntrup4591761x25519_putkemkey(struct buf *, const unsigned char *);
+#if defined(crypto_kem_sntrup761x25519_BYTES) && defined(crypto_hash_sha512_BYTES)
+/* sshcrypto_kex_sntrup761x25519.c */
+extern void sntrup761x25519_putkemkey(struct buf *, const unsigned char *);
 #endif
 
 /* key - sign */
diff -pruN 20190101-1/tinyssh/sshcrypto_kex.c 20220801-1/tinyssh/sshcrypto_kex.c
--- 20190101-1/tinyssh/sshcrypto_kex.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/sshcrypto_kex.c	2022-07-17 07:30:14.000000000 +0000
@@ -38,15 +38,15 @@ struct sshcrypto_kex sshcrypto_kexs[] =
         0,
     },
 #endif
-#if defined(crypto_kem_sntrup4591761x25519_BYTES) && defined(crypto_hash_sha512_BYTES)
-    {   "sntrup4591761x25519-sha512@tinyssh.org",
-        crypto_kem_sntrup4591761x25519_enc,
-        crypto_kem_sntrup4591761x25519_PUBLICKEYBYTES,   /* pk */
-        crypto_kem_sntrup4591761x25519_CIPHERTEXTBYTES,  /* c */
-        crypto_kem_sntrup4591761x25519_BYTES,            /* k */
+#if defined(crypto_kem_sntrup761x25519_BYTES) && defined(crypto_hash_sha512_BYTES)
+    {   "sntrup761x25519-sha512@openssh.com",
+        crypto_kem_sntrup761x25519_enc,
+        crypto_kem_sntrup761x25519_PUBLICKEYBYTES,   /* pk */
+        crypto_kem_sntrup761x25519_CIPHERTEXTBYTES,  /* c */
+        crypto_kem_sntrup761x25519_BYTES,            /* k */
         crypto_hash_sha512,
         crypto_hash_sha512_BYTES,
-        sntrup4591761x25519_putkemkey,
+        sntrup761x25519_putkemkey,
         sshcrypto_TYPEPQCRYPTO,
         0,
     },
diff -pruN 20190101-1/tinyssh/sshcrypto_kex_sntrup4591761x25519.c 20220801-1/tinyssh/sshcrypto_kex_sntrup4591761x25519.c
--- 20190101-1/tinyssh/sshcrypto_kex_sntrup4591761x25519.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/sshcrypto_kex_sntrup4591761x25519.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,15 +0,0 @@
-/*
-20181225
-Jan Mojzis
-Public domain.
-*/
-
-#include "buf.h"
-#include "crypto.h"
-#include "sshcrypto.h"
-
-#if defined(crypto_kem_sntrup4591761x25519_BYTES) && defined(crypto_hash_sha512_BYTES)
-void sntrup4591761x25519_putkemkey(struct buf *b, const unsigned char *x) {
-    buf_putstringlen(b, x, crypto_kem_sntrup4591761x25519_BYTES);
-}
-#endif
diff -pruN 20190101-1/tinyssh/sshcrypto_kex_sntrup761x25519.c 20220801-1/tinyssh/sshcrypto_kex_sntrup761x25519.c
--- 20190101-1/tinyssh/sshcrypto_kex_sntrup761x25519.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/tinyssh/sshcrypto_kex_sntrup761x25519.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,15 @@
+/*
+20210314
+Jan Mojzis
+Public domain.
+*/
+
+#include "buf.h"
+#include "crypto.h"
+#include "sshcrypto.h"
+
+#if defined(crypto_kem_sntrup761x25519_BYTES) && defined(crypto_hash_sha512_BYTES)
+void sntrup761x25519_putkemkey(struct buf *b, const unsigned char *x) {
+    buf_putstringlen(b, x, crypto_kem_sntrup761x25519_BYTES);
+}
+#endif
diff -pruN 20190101-1/tinyssh/subprocess_auth.c 20220801-1/tinyssh/subprocess_auth.c
--- 20190101-1/tinyssh/subprocess_auth.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/subprocess_auth.c	2022-07-17 07:30:14.000000000 +0000
@@ -49,7 +49,7 @@ static void check(uid_t uid, const char
         if (stat(d, &st) == -1) { log_w4("auth: unable to stat directory: ", d, "/", f); e = 1; }
         if (e == 0 && !S_ISDIR(st.st_mode)) { errno = ENOTDIR; log_w4("auth: unable to stat directory: ", d, "/", f); e = 1; }
     }
-    if (e == 0 && (st.st_mode & 022) != 0) { errno = EACCES; log_w4("auth: bad mode: ", d, "/", f); e = 1; }
+    if (e == 0 && (st.st_mode & 022) != 0) { errno = EACCES; log_w4("auth: bad mode: directory writable by group or others: ", d, "/", f); e = 1; }
     if (e == 0 && st.st_uid != uid && st.st_uid != 0) { errno = EACCES; log_w4("auth: bad owner: ", d, "/", f); e = 1; }
 
     if (e) *err = 1;
@@ -87,14 +87,14 @@ int subprocess_auth_authorizedkeys_(cons
 
     fd = open_read("authorized_keys");
     if (fd == -1) {
-        log_w3("auth: unable to open file: ", dir, "/authorized_keys");
+        log_w3("auth: unable to open file: ", dir, "/.ssh/authorized_keys");
         return 0;
     }
 
     do {
         r = getln(fd, buf, bufmax);
         if (r == -1) {
-            log_w3("auth: unable to read from file ", dir, "/authorized_keys");
+            log_w3("auth: unable to read from file ", dir, "/.ssh/authorized_keys");
             return 0;
         }
         if (findnameandkey(keyname, key, buf)) return 1; /* authorized */
diff -pruN 20190101-1/tinyssh/TARGETS 20220801-1/tinyssh/TARGETS
--- 20190101-1/tinyssh/TARGETS	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/TARGETS	2022-07-17 07:30:14.000000000 +0000
@@ -1,3 +1,4 @@
 tinysshd
+tinysshnoneauthd
 tinysshd-makekey
 tinysshd-printkey
diff -pruN 20190101-1/tinyssh/tinysshd.c 20220801-1/tinyssh/tinysshd.c
--- 20190101-1/tinyssh/tinysshd.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/tinysshd.c	2022-07-17 07:30:14.000000000 +0000
@@ -41,8 +41,11 @@ int main(int argc, char **argv) {
     else if (str_equaln(x, xlen, "tinysshd-makekey")){
         return main_tinysshd_makekey(argc, argv);
     }
+    else if (str_equaln(x, xlen, "tinysshnoneauthd")){
+        return main_tinysshd(argc, argv, "tinysshnoneauthd");
+    }
     else {
-        return main_tinysshd(argc, argv);
+        return main_tinysshd(argc, argv, "tinysshd");
     }
 
     _exit(111);
diff -pruN 20190101-1/tinyssh/tinysshd.exp 20220801-1/tinyssh/tinysshd.exp
--- 20190101-1/tinyssh/tinysshd.exp	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/tinysshd.exp	2022-07-17 07:30:14.000000000 +0000
@@ -16,7 +16,7 @@
 
 --- tinysshd default setup
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -25,7 +25,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -osp
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -34,7 +34,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -o -s -p
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -61,7 +61,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -oSp
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -70,7 +70,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -o -S -p
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -97,7 +97,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -Osp
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -106,7 +106,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -O -s -p
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -133,7 +133,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -OSp
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -142,7 +142,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -O -S -p
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -169,7 +169,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -osp, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -178,7 +178,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -o -s -p, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -205,7 +205,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -oSp, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -214,7 +214,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -o -S -p, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -241,7 +241,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -Osp, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -250,7 +250,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -O -s -p, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms: ssh-ed25519 
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -277,7 +277,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -OSp, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -286,7 +286,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -O -S -p, ecdsa-sha2-nistp256 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -313,7 +313,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -osp, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -322,7 +322,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -o -s -p, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -349,7 +349,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -oSp, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -358,7 +358,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -o -S -p, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -385,7 +385,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -Osp, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -394,7 +394,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -O -s -p, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -421,7 +421,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -OSp, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
@@ -430,7 +430,7 @@ _tinysshd-printkex: info: mac algorithms
 
 --- tinysshd recognizes -O -S -p, ssh-ed25519 key missing
 
-_tinysshd-printkex: info: kex algorithms: sntrup4591761x25519-sha512@tinyssh.org 
+_tinysshd-printkex: info: kex algorithms: sntrup761x25519-sha512@openssh.com 
 _tinysshd-printkex: info: server host key algorithms:  
 _tinysshd-printkex: info: encryption algorithms client to server: chacha20-poly1305@openssh.com 
 _tinysshd-printkex: info: encryption algorithms server to client: chacha20-poly1305@openssh.com 
diff -pruN 20190101-1/tinyssh/tinysshd-makekey.c 20220801-1/tinyssh/tinysshd-makekey.c
--- 20190101-1/tinyssh/tinysshd-makekey.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/tinysshd-makekey.c	2022-07-17 07:30:14.000000000 +0000
@@ -41,8 +41,11 @@ int main(int argc, char **argv) {
     else if (str_equaln(x, xlen, "tinysshd-makekey")){
         return main_tinysshd_makekey(argc, argv);
     }
+    else if (str_equaln(x, xlen, "tinysshnoneauthd")){
+        return main_tinysshd(argc, argv, "tinysshnoneauthd");
+    }
     else {
-        return main_tinysshd(argc, argv);
+        return main_tinysshd(argc, argv, "tinysshd");
     }
 
     _exit(111);
diff -pruN 20190101-1/tinyssh/tinysshd-printkey.c 20220801-1/tinyssh/tinysshd-printkey.c
--- 20190101-1/tinyssh/tinysshd-printkey.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh/tinysshd-printkey.c	2022-07-17 07:30:14.000000000 +0000
@@ -41,8 +41,11 @@ int main(int argc, char **argv) {
     else if (str_equaln(x, xlen, "tinysshd-makekey")){
         return main_tinysshd_makekey(argc, argv);
     }
+    else if (str_equaln(x, xlen, "tinysshnoneauthd")){
+        return main_tinysshd(argc, argv, "tinysshnoneauthd");
+    }
     else {
-        return main_tinysshd(argc, argv);
+        return main_tinysshd(argc, argv, "tinysshd");
     }
 
     _exit(111);
diff -pruN 20190101-1/tinyssh/tinysshnoneauthd.c 20220801-1/tinyssh/tinysshnoneauthd.c
--- 20190101-1/tinyssh/tinysshnoneauthd.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/tinyssh/tinysshnoneauthd.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,53 @@
+/*
+20181206
+Jan Mojzis
+Public domain.
+*/
+
+/*
+Multi-call binary wrapper
+*/
+
+#include <unistd.h>
+#include "str.h"
+#include "main.h"
+
+static char *basename(char *str) {
+
+    char *s;
+    char *ret = str;
+
+    for (s = str; *s; ++s) {
+        if (*s == '/') ret = s + 1;
+    }
+    return ret;
+}
+
+static char *x;
+static long long xlen;
+
+int main(int argc, char **argv) {
+
+    if (argc < 1) _exit(100);
+    if (!argv[0]) _exit(100);
+
+    x = basename(argv[0]);
+    if (!x) _exit(100);
+    xlen = str_len(x);
+
+    if (str_equaln(x, xlen, "tinysshd-printkey")) {
+        return main_tinysshd_printkey(argc, argv);
+    }
+    else if (str_equaln(x, xlen, "tinysshd-makekey")){
+        return main_tinysshd_makekey(argc, argv);
+    }
+    else if (str_equaln(x, xlen, "tinysshnoneauthd")){
+        return main_tinysshd(argc, argv, "tinysshnoneauthd");
+    }
+    else {
+        return main_tinysshd(argc, argv, "tinysshd");
+    }
+
+    _exit(111);
+    return 111;
+}
diff -pruN 20190101-1/tinyssh/tinysshnoneauthd.rts 20220801-1/tinyssh/tinysshnoneauthd.rts
--- 20190101-1/tinyssh/tinysshnoneauthd.rts	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/tinyssh/tinysshnoneauthd.rts	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,2 @@
+#!/bin/sh
+exit 0
diff -pruN 20190101-1/_tinyssh/_TARGETS 20220801-1/_tinyssh/_TARGETS
--- 20190101-1/_tinyssh/_TARGETS	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/_tinyssh/_TARGETS	2022-07-17 07:30:14.000000000 +0000
@@ -1,6 +1,5 @@
 _tinysshd-printkex
 _tinysshd-unauthenticated
-_tinysshd-install
 _tinysshd-test-hello1
 _tinysshd-test-hello2
 _tinysshd-test-kex1
diff -pruN 20190101-1/_tinyssh/_tinysshd-install.c 20220801-1/_tinyssh/_tinysshd-install.c
--- 20190101-1/_tinyssh/_tinysshd-install.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/_tinyssh/_tinysshd-install.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,96 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdio.h>
-#include "open.h"
-#include "log.h"
-
-
-static void usage(void) {
-
-    log_u1("_tinysshd-install: usage: _tinysshd-install sourcefile destdir tempfile destfile [flagexecutable]");
-    _exit(100);
-}
-
-static int flagtmpcreated = 0;
-static const char *srcfn = 0;
-static const char *tmpfn = 0;
-static const char *dstfn = 0;
-static const char *dstdir = 0;
-static int fd1 = -1, fd2 = -1;
-
-static void cleanup(void) {
-    if (flagtmpcreated) {
-        unlink(tmpfn);
-    }
-}
-
-static void die_fatal(const char *trouble, const char *d, const char *fn) {
-
-    cleanup();
-
-    if (d) {
-        if (fn) log_f5(trouble, " ", d, "/", fn);
-        else log_f3(trouble, " ", d);
-    }
-    else {
-        log_f1(trouble);
-    }
-    _exit(111);
-}
-
-static int flagexecutable = 0;
-
-int main(int argc, char **argv) {
-
-    struct stat st;
-    long long r;
-    char ch;
-
-    log_init(2, "_tinysshd-install", 0, 0);
-
-    if (argc < 5) usage();
-    if (!argv[0]) usage();
-    if (!argv[1]) usage();
-    if (!argv[2]) usage();
-    if (!argv[3]) usage();
-    if (!argv[4]) usage();
-
-    srcfn = argv[1];
-    dstdir  = argv[2];
-    tmpfn = argv[3];
-    dstfn = argv[4];
-    if (argv[5]) flagexecutable = 1;
-
-    /* open source file */
-    fd1 = open_read(srcfn);
-    if (fd1 == -1) die_fatal("unable to open file", srcfn, 0);
-
-    /* stat destination directory and change directory */
-    if ((stat(dstdir, &st)) == -1) die_fatal("unable to stat directory", dstdir, 0);
-    if (chdir(dstdir) == -1) die_fatal("unable to change directory to", dstdir, 0);
-
-    /* open temporary file */
-    fd2 = open_write(tmpfn);
-    if (fd2 == -1) die_fatal("unable to open file", dstdir, tmpfn);
-    flagtmpcreated = 1;
-
-    /* copy file */
-    for (;;) {
-        r = read(fd1, &ch, 1);
-        if (r == -1) die_fatal("unable to read from file", srcfn, 0);
-        if (r == 0) break;
-        if (write(fd2, &ch, 1) != 1) die_fatal("unable to write to file", dstdir, tmpfn);
-    }
-    if (fsync(fd2) == -1) die_fatal("unable to write to file", dstdir, tmpfn);
-    if (fchown(fd2, st.st_uid, st.st_gid) == -1) die_fatal("unable to change owner on", dstdir, tmpfn);
-    if (flagexecutable) {
-        if (fchmod(fd2, 0755) == -1) die_fatal("unable to change owner on", dstdir, tmpfn);
-    }
-    else {
-        if (fchmod(fd2, 0644) == -1) die_fatal("unable to change owner on", dstdir, tmpfn);
-    }
-    if (close(fd2) == -1) die_fatal("unable to write to file", dstdir, tmpfn);
-    if (rename(tmpfn, dstfn) == -1) die_fatal("unable to rename file to", dstdir, dstfn);
-    _exit(0);
-}
diff -pruN 20190101-1/tinyssh-tests/channeltest.c 20220801-1/tinyssh-tests/channeltest.c
--- 20190101-1/tinyssh-tests/channeltest.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh-tests/channeltest.c	2022-07-17 07:30:14.000000000 +0000
@@ -32,8 +32,12 @@ static char *name(void) {
 
 /* channel can't be opened 2x */
 static void testopen1(void) {
-    channel_open(user, id, remotewindow, maxpacket, &localwindow);
-    channel_open(user, id, remotewindow, maxpacket, &localwindow);
+    int r;
+    r = channel_open(user, id, remotewindow, maxpacket, &localwindow);
+    if (r != 1) fail("first channel_open not returns 1");
+    r = channel_open(user, id, remotewindow, maxpacket, &localwindow);
+    if (r != 0) fail("first channel_open not returns 0");
+    _exit(0);
 }
 
 /* *localwindow can't be 0 */
@@ -201,6 +205,32 @@ static int homedir(void) {
     return 1 + stat(pw->pw_dir, &st);
 }
 
+static int shell(void) {
+
+    pid_t pid;
+    int status;
+
+    pid = fork();
+    if (pid == -1) return 0;
+    if (pid == 0) {
+        struct passwd *pw;
+        char *run[4];
+        pw = getpwuid(geteuid());
+        if (!pw) _exit(1);
+        run[0] = pw->pw_shell;
+        run[1] = (char *)"-c";
+        run[2] = (char *)"exit 0";
+        run[3] = (char *)0;
+        execvp(run[0], run);
+        _exit(1);
+    }
+
+    while (waitpid(pid, &status, 0) != pid) {};
+    if (!WIFEXITED(status)) return 0;
+    if (WEXITSTATUS(status)) return 0;
+    return 1;
+}
+
 
 int main(void) {
 
@@ -210,7 +240,13 @@ int main(void) {
         _exit(0);
     }
 
-    run_mustfail(testopen1);
+    /* don't run check when shell returns non-zero */
+    if (!shell()) {
+        warn("shell returns non-zero - skipping tests")
+        _exit(0);
+    }
+
+    run_mustpass(testopen1);
     run_mustfail(testopen2);
     run_mustfail(testopen3);
     run_mustfail(testopen4);
@@ -232,10 +268,13 @@ int main(void) {
 
     run_mustfail(testwrite1);
 
+    /* temp. disable the rest */
+    _exit(0);
+
     run_mustpass(testok1);
     run_mustpass(testok2);
     run_mustpass(testok3);
     run_mustpass(testok4);
-;
+
     _exit(0);
 }
diff -pruN 20190101-1/tinyssh-tests/sshcrypto_kex_sntrup4591761x25519test.c 20220801-1/tinyssh-tests/sshcrypto_kex_sntrup4591761x25519test.c
--- 20190101-1/tinyssh-tests/sshcrypto_kex_sntrup4591761x25519test.c	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/tinyssh-tests/sshcrypto_kex_sntrup4591761x25519test.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
-/*
-20140319
-Jan Mojzis
-Public domain.
-*/
-
-#include <unistd.h>
-
-int main(void) {
-
-    _exit(0);
-}
diff -pruN 20190101-1/tinyssh-tests/sshcrypto_kex_sntrup761x25519test.c 20220801-1/tinyssh-tests/sshcrypto_kex_sntrup761x25519test.c
--- 20190101-1/tinyssh-tests/sshcrypto_kex_sntrup761x25519test.c	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/tinyssh-tests/sshcrypto_kex_sntrup761x25519test.c	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,12 @@
+/*
+20140319
+Jan Mojzis
+Public domain.
+*/
+
+#include <unistd.h>
+
+int main(void) {
+
+    _exit(0);
+}
diff -pruN 20190101-1/tools/tinyssh-convert 20220801-1/tools/tinyssh-convert
--- 20190101-1/tools/tinyssh-convert	1970-01-01 00:00:00.000000000 +0000
+++ 20220801-1/tools/tinyssh-convert	2022-07-17 07:30:14.000000000 +0000
@@ -0,0 +1,153 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import base64
+import struct
+
+
+"""
+        byte[]        AUTH_MAGIC = "openssh-key-v1\x00"
+        string        ciphername
+        string        kdfname
+        string        kdfoptions
+        int        number of keys N
+        string        publickey1
+        string        publickey2
+        ...
+        string        publickeyN
+        string        encrypted, padded list of private keys
+"""
+
+class Parser:
+        """
+        """
+
+        def __init__(self, data = b""):
+                """
+                """
+
+                self.data = data 
+
+        def parse_magic(self):
+                """
+                """
+
+                if len(self.data) < 15 or not self.data.startswith(b"openssh-key-v1\x00"):
+                        raise Exception("unable to parse OpenSSH key: magic 'openssh-key-v1' not found")
+                self.data = self.data[15:]
+
+        def parse_num(self, text):
+                """
+                """
+
+                if (4 > len(self.data)):
+                        raise Exception(f"unable to parse OpenSSH key: bad ssh-num {text}")
+
+                num = struct.unpack('>I', self.data[:4])[0]
+                self.data = self.data[4:]
+                return num
+
+        def parse_string(self, text):
+                """
+                """
+
+                num = self.parse_num(text)
+
+                if (num > len(self.data)):
+                        raise Exception(f"unable to parse OpenSSH key: bad ssh-string {text}")
+
+                ret = self.data[:num]
+                self.data = self.data[num:]
+                return ret
+
+def usage(f = ""):
+        """
+        """
+
+        if len(f) != 0:
+                print("tinyssh-convert: fatal: %s" % (f))
+        print("tinyssh-convert: usage: tinyssh-convert out-tinysshkeydir < in-opensshfile")
+        print()
+        exit(100)
+
+def writesync(fn = "", data = b""):
+        """
+        """
+
+        f = open(fn, 'wb')
+        f.write(data)
+        f.flush()
+        os.fsync(f.fileno())
+        f.close()
+
+
+if __name__ == "__main__":
+
+        if len(sys.argv) != 2:
+                usage("")
+        d=sys.argv[1]
+
+        if os.path.exists(d):
+                usage("out-tinysshkeydir exist")
+
+        lines = sys.stdin.readlines()
+        data = ""
+        flagbegin = 0
+        for line in lines:
+                if line.startswith("-----BEGIN OPENSSH PRIVATE KEY-----"):
+                        flagbegin = 1
+                        continue
+                if line.startswith("-----END OPENSSH PRIVATE KEY-----"):
+                        break
+                if flagbegin:
+                        data += line
+
+        if flagbegin == 0:
+                raise Exception("unable to parse OpenSSH key: no line -----BEGIN OPENSSH PRIVATE KEY----- found")
+
+        data = base64.b64decode(data)
+
+        # parse key
+        p = Parser(data)
+        p.parse_magic()
+        ciphername = p.parse_string("ciphername")
+        if ciphername != b'none':
+                raise Exception("unable to parse OpenSSH key: can't convert encrypted key: ciphername != none")
+        kdfname = p.parse_string("kdfname")
+        if kdfname != b'none':
+                raise Exception("unable to parse OpenSSH key: can't convert encrypted key: kdfname != none")
+        kdfoptions = p.parse_string("kdfoptions")
+        if kdfoptions != b'':
+                raise Exception("unable to parse OpenSSH key: can't convert encrypted key: kdfoptions != ''")
+        pklen = p.parse_num("publickeys")
+        if (pklen != 1):
+                raise Exception("unable to parse OpenSSH key: more than one key in the file")
+
+        pkssh = p.parse_string("publickey")
+        skssh = p.parse_string("secretkeys")
+
+        # parse secret key
+        p = Parser(skssh)
+        p.parse_num("checkint")
+        p.parse_num("checkint")
+        sk = []
+        t = p.parse_string("secret-key type")
+        if t != b'ssh-ed25519':
+                raise Exception(f"unable to parse OpenSSH key: secret-key type={t}: not ssh-ed25519 key")
+        pk = p.parse_string("public-key")
+        pklen = len(pk)
+        sk = p.parse_string("secret-key")
+        sklen = len(sk)
+        p.parse_string("comment")
+        if pklen != 32:
+                raise Exception(f"unable to parse OpenSSH key: public-key length={pklen}: not 32")
+        if sklen != 64:
+                raise Exception(f"unable to parse OpenSSH key: secret-key length={sklen}: not 64")
+
+        os.umask(0o0022)
+        os.mkdir(d)
+        os.chdir(d)
+        writesync("ed25519.pk", pk)
+        os.umask(0o0077)
+        writesync(".ed25519.sk", sk)
diff -pruN 20190101-1/.travis.yml 20220801-1/.travis.yml
--- 20190101-1/.travis.yml	2019-01-01 19:19:31.000000000 +0000
+++ 20220801-1/.travis.yml	2022-07-17 07:30:14.000000000 +0000
@@ -1,22 +1,36 @@
 language: c
 
-os:
-  - linux
-  - osx
-osx_image: xcode7.3
-
-cache:
-  ccache: true
-
-# opt-in Ubuntu Trusty
-sudo: required
-dist: trusty
-
+jobs:
+  include:
+    -
+      os: linux
+      dist: focal
+      arch: amd64
+      addons:
+        apt:
+          packages:
+            - build-essential
+            - curl
+    -
+      os: linux
+      dist: focal
+      arch: s390x
+      addons:
+        apt:
+          packages:
+            - build-essential
+            - curl
+    -
+      os: osx
+    -
+      os: freebsd
+      addons:
+        pkg:
+          - curl
 
 script:
   - cd "$TRAVIS_BUILD_DIR"
+  - $CC -dM -E - < /dev/null
   - make
 
-after_success:
-  - cd "$TRAVIS_BUILD_DIR"
-  - sudo make install
+install: skip
