@SuppressWarnings("WeakerAccess") public static Salsa20Engine createSalsa20(byte[] key){
  MessageDigest md=Encryption.getMessageDigestInstance();
  KeyParameter keyParameter=new KeyParameter(md.digest(key));
  ParametersWithIV ivParameter=new ParametersWithIV(keyParameter,SALSA20_IV);
  Salsa20Engine engine=new Salsa20Engine();
  engine.init(true,ivParameter);
  return engine;
}

@ SuppressWarnings ( "WeakerAccess" ) public static Salsa20Engine createSalsa20 ( byte [ ] key ) { MessageDigest md = Encryption . getMessageDigestInstance ( ) ; KeyParameter keyParameter = new KeyParameter ( md . digest ( key ) ) ; ParametersWithIV ivParameter = new ParametersWithIV ( keyParameter , SALSA20_IV ) ; Salsa20Engine engine = new Salsa20Engine ( ) ; engine . init ( true , ivParameter ) ; return engine ; }
creates a salsa20 engine
