- case SPTPS_CHACHA_POLY1305:
- chacha_poly1305_encrypt(ctx, seqno, in, inlen, out, outlen);
+ case SPTPS_CHACHA_POLY1305: {
+ if(chachapoly_crypt(ctx, nonce, NULL, 0, (void *)in, inlen, out, out + inlen, 16, 1) != CHACHAPOLY_OK) {
+ return false;
+ }
+
+ if(outlen) {
+ *outlen = inlen + 16;
+ }
+