Skip to content

Commit

Permalink
Merge 7f82bc4 into 369575c
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-scott committed Mar 3, 2017
2 parents 369575c + 7f82bc4 commit ab6177a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/rbnacl/group_elements/curve25519.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ def mult(integer)
Util.check_length(integer, SCALARBYTES, "integer")

result = Util.zeros(SCALARBYTES)
self.class.scalarmult_curve25519(result, integer, @point)

self.class.new(result)
if self.class.scalarmult_curve25519(result, integer, @point)
self.class.new(result)
else
raise CryptoError, "Invalid curve25519 result"
end
end

# Return the point serialized as bytes
Expand Down

0 comments on commit ab6177a

Please sign in to comment.