   encrypt : (R, cb) ->
     await @random_scalar defer v
 
-    V = new Buffer(tweetnacl.scalarMult.base(v))
-    S = new Buffer(tweetnacl.scalarMult(v, R))
+    nacl = kbnacl.alloc {}
+
+    V = nacl.scalarmult_base(v)
+    S = nacl.scalarmult(v, R)
 
     cb {V, S}
 

  decrypt : (x, V) ->
    # nacl expects scalar in reverse order to what is saved in pgp packet.
    x = Curve25519.reverse_buf(x)
    S = new Buffer(tweetnacl.scalarMult(x, V))
    S

  #----------------------------------

{SlicerBuffer} = require '../openpgp/buffer'
{SRF} = require '../rand'
bn = require '../bn'
kbnacl = require 'keybase-nacl'

#=================================================================

