 
 func vn(_ x:[Int], _ xi:Int, _ y:[Int], _ yi:Int, _ n:Int) -> Int {
     var d: Int = 0
-	for i in 0..<n {
-		d = d | ( x[xi+i] ^ y[yi+i] )
-	}
-	return (1 & ( (d - 1 ) >>> 8 ) ) - 1
+    for i in 0..<n {
+        d = d | ( x[xi+i] ^ y[yi+i] )
+    }
+    return (1 & ( (d - 1 ) >>> 8 ) ) - 1
 }
 
 func crypto_verify_32(_ x:[Int], _ xi:Int, _ y:[Int], _ yi:Int) -> Int {


print("respuesas: R1=\(res == 1 ? "SI" : "NO") R2=\(res1 == 1 ? "SI" : "NO")")
print("msg2 = \(msg2)" )
	

  var ab = [Int64](repeating: 0, count: 16)
    
  for i in 0..<16 {
      ab[i] = b[i]
  }
    
  var v: Int64
  for i in 0..<16 {
      v = a[i]
      for j in 0..<16 {             
        at[j+i] += v * ab[j]
      } 
  }
  
  for i in 0..<15 {
      at[i] += 38 * at[i+16]
  }
  // t15 left as is  
        
  // first car
  var c: Int = 1
  for i in 0..<16 {            
      v =  at[i] + Int64( c + 65535 )
      c = Int( floor(Double(v) / 65536.0) )      
      at[i] = v - Int64( c * 65536 )
  } 
  at[0] += Int64( c-1 + 37 * (c-1) )
        
  // second car
  c = 1
  for i in 0..<16 {
      v =  at[i] + Int64( c + 65535 )
      c = Int( floor(Double(v) / 65536.0) )
      at[i] = v - Int64( c * 65536 )
  }
  at[0] += Int64( c-1 + 37 * (c-1) )
    
  for i in 0..<16 {
      o[i] = at[i]
  }
    
}

func S(_ o:inout [Int64], _ a:[Int64]) {
    M(&o, a, a)
}

func inv25519(_ o:inout [Int64], _ i:[Int64]) {      
    var c = gf()
    for a in 0..<16 {
        c[a] = i[a]
    }
    
    for a in (0..<254).reversed() {
        S(&c, c)
        if(a != 2 && a != 4) {
            M(&c, c, i)
        }
    }
    for a in 0..<16 {
        o[a] = c[a]
    }
}

func pow2523(_ o:inout [Int64], _ i:[Int64]) {
    var c = gf()
    for a in 0..<16 {
        c[a] = i[a]
    }
    for a in (0...250).reversed() {
        S(&c, c)
        if(a != 1) {
            M(&c, c, i)
        }
    }
    for a in 0..<16 {
        o[a] = c[a]
    }
}

func crypto_scalarmult(_ q:inout [Int], _ n:[Int], _ p:[Int]) -> Int {
    var z = [Int](repeating: 0, count: 32)
    var x = [Int64](repeating: 0, count: 80)
    var r: Int
    
    var a = gf()
    var b = gf()
    var c = gf()
    var d = gf()
    var e = gf()
    var f = gf()
  
    for i in 0..<31 {
        z[i] = n[i]
    }
    z[31] = (n[31] & 127) | 64
    z[0] = z[0] & 248
        
    unpack25519(&x,p)
    
    for i in 0..<16 {
        b[i] = x[i]
        d[i] = 0
        a[i] = 0
        c[i] = 0
    }   
    a[0] = 1
    d[0] = 1
            
    for i in (0...254).reversed() {
                
        r = ( z[i >>> 3] >>> (i & 7) ) & 1 
        
        sel25519(&a,&b,r)
        sel25519(&c,&d,r)   
                                
        A(&e,a,c)
        Z(&a,a,c)
        A(&c,b,d)
        Z(&b,b,d)
        S(&d,e)
        S(&f,a)
        M(&a,c,a)
        M(&c,b,e)
        A(&e,a,c)
        Z(&a,a,c)
        S(&b,a)
        Z(&c,d,f)
        
        M(&a,c,_121665)
        A(&a,a,d)
        M(&c,c,a)
        M(&a,d,f)
        M(&d,b,x)
        S(&b,e)
        
        sel25519(&a,&b,r)
        sel25519(&c,&d,r)
                
    }
            
    for i in 0..<16 {
        x[i+16]=a[i]
        x[i+32]=c[i]
        x[i+48]=b[i]
        x[i+64]=d[i]
    }
      
    var x32 = Array(x[32..<x.count])
    var x16 = Array(x[16..<x.count])
        
    inv25519(&x32,x32)
    
    M(&x16,x16,x32)
    
    pack25519(&q,x16)
    
    return 0
}

func crypto_scalarmult_base(_ q:inout [Int], _ n:[Int]) -> Int {
