Commit Graph

32 Commits

Author SHA1 Message Date
Aidan Woods 48b08e47f0
Defer to Swift's own handling for most pointers
Reference: https://developer.apple.com/swift/blog/?id=6
2018-04-27 12:56:21 +01:00
Aidan Woods 24474c9987
Make SecretBox implement Nonce and SecretKey generator 2018-04-26 20:39:26 +01:00
Aidan Woods 80a176fab6
Fold simple (and nil returning) guards onto single line 2018-04-26 18:47:48 +01:00
Aidan Woods f0d4423372
Fold complex guards onto multiple lines 2018-04-26 18:46:07 +01:00
Aidan Woods 2e865a30ce
Use ExitCode enum to encompass numeric exit status 2018-04-26 17:41:44 +01:00
Aidan Woods 520ab42176
Remove unneeded mutability 2018-04-26 15:35:50 +01:00
Aidan Woods 40ae417cbd
Take advantage of subscripts and once-sided ranges 2018-04-24 02:00:08 +01:00
Aidan Woods ab35079abf
Use guards where intention is to return 2018-04-22 13:39:18 +01:00
Aidan Woods 1900f04bf8
Use constant local variables in-place of computed property of mutable value 2018-04-20 21:16:00 +01:00
Daniel Seither d590b856cf Return non-optional key if keygen is guaranteed to succeed
Returning a non-optional value saves the client code from unnecessary
error checking or generous use of force-unwraps.

This is a revised version of #125 which got reverted in #129 due to the
README not being updated.
2018-04-18 11:41:53 +02:00
Frank Denis f27a15e1f3
Revert "Return non-optional key if keygen is guaranteed to succeed" 2018-03-20 14:22:37 +01:00
Daniel Seither 00698267cf Return non-optional key if keygen is guaranteed to succeed
Returning a non-optional value saves the client code from unnecessary
error checking or generous use of force-unwraps.
2018-02-27 13:13:00 +01:00
Daniel Seither e9ce2e11a2 Rename libsodium module to Clibsodium to match the Swift naming rules 2018-02-19 13:36:16 +01:00
Frank Denis f977141b51 Remove these useless headers 2017-09-23 20:24:18 +02:00
Frank Denis 494716a51d First pass to make the code a tiny bit more consistent 2017-09-23 20:08:19 +02:00
Frank Denis 41871eb2f2 Reindent everything and add tests for SecretStream 2017-09-22 00:14:37 +02:00
Maximilian Blochberger 6845200f10
Use Swift module rather than umbrella header for bindings
Details are explained in a StackOverflow answer [1], which unfortunately
is not accepted at the time of this commit.

[1] http://stackoverflow.com/a/37072619/5082444
2017-04-28 15:16:38 +02:00
Frank Denis dcd7d36640 Fix a couple inconsistencies in comments 2017-04-02 08:15:09 -07:00
Frank Denis 3b7b37eb13 Use _keygen() functions instead of _randombytes() when applicable
Also fix some inconsistencies
2017-04-02 08:07:06 -07:00
Joseph Ross 1f3dcefd36 Added Swift documentation. For #24. 2017-01-14 13:07:33 -08:00
Nathan Kot 3dd326d243
Update all interfaces to use the new Data type 2017-01-10 20:34:00 +09:00
Maximilian Blochberger 7edaf5d9e4
Remove trailing whitespace
This is a whitespace only commit.
2016-10-21 10:34:39 +02:00
Alexander Zautke a70002cf8c Fix UnsafeMutableRawPointer / UnsafeMutablePointer<T> casting errors 2016-09-07 17:05:56 +02:00
Alexander Zautke 7dabe2eaae Use NSData consistently 2016-09-07 17:05:50 +02:00
Alexander Zautke 7755edbeb2 Convert NSData explicitly to Data (new value type in Swift 3) 2016-08-15 17:49:54 +02:00
Alexander Zautke 611ffb712a Fix '...has been renamed to ... ' 2016-08-12 13:39:49 +02:00
Alexander Zautke 33be9fc89d Fix 'Missing argument label in call' 2016-08-12 13:35:53 +02:00
Bruno Koga d9acde0411 Adopts guard syntax for early exits
Swift 2 introduced the guard keyword which can be used to early exits.
Adopting it makes the code a little bit cleaner (although less cheerful, without all the exclamation marks :)
2015-12-16 12:07:13 +01:00
Frank Denis 29702ddb97 Port to Swift 1.2 2015-03-05 09:27:42 +01:00
Frank Denis 3a692038e1 Use mutableBytesPtr in SecretBox as well 2015-01-06 14:53:26 +01:00
Frank Denis a85af4a614 Rename bytePtr and mBytePtr to bytesPtr and mutableBytesPtr.
Longer, but consistent with names used by the Foundation framework.
2015-01-06 11:35:48 +01:00
Devin Chalmers fea9bf74a4 Add secretbox support 2015-01-05 22:00:07 -08:00