code: public static byte[] keyGenPrivate(byte[] randomBytes) throws NoSuchAlgorithmException, DigestException {
  
          if (randomBytes.length < 32) {
              throw new RuntimeException("Random bytes too small");
          }
  
          // Hashing Random Bytes instead of using random bytes directly
          // Just in case as reference ed255519 implementation do same
          MessageDigest digest = MessageDigest.getInstance("SHA-256");
          digest.digest(randomBytes, 0, randomBytes.length);
          byte[] privateKey = digest.digest();
  
          // Performing bit's flipping
          privateKey[0] &= 248;
          privateKey[31] &= 127;
          privateKey[31] |= 64;
  
          return privateKey;
      }
docs: Generating private key. Source: https://cr.yp.to/ecdh.html
  
  @param randomBytes random bytes (32+ bytes)
  @return generated private key