code: protected int getDigestOffset2(byte[] handshake, int bufferOffset) {
          bufferOffset += 772;
          int offset = handshake[bufferOffset] & 0xff; // & 0x0ff;
          bufferOffset++;
          offset += handshake[bufferOffset] & 0xff;
          bufferOffset++;
          offset += handshake[bufferOffset] & 0xff;
          bufferOffset++;
          offset += handshake[bufferOffset] & 0xff;
          int res = Math.abs((offset % 728) + 776);
          if (res + DIGEST_LENGTH > 1535) {
              log.error("Invalid digest offset calc: {}", res);
          }
          return res;
      }
docs: Returns a digest byte offset.
  
  @param handshake handshake sequence
  @param bufferOffset buffer offset
  @return digest offset