Commit 824a8aa6 authored by Drew's avatar Drew

Build on atbuild (OSX)

parent 27d1d9c6
......@@ -5,7 +5,9 @@
// Created by Drew Crawford on 12/12/15.
// Copyright © 2015 DrewCrawfordApps. All rights reserved.
//
#if ATBUILD
import CSodium
#endif
import Foundation
extension Array {
......
......@@ -9,7 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
public struct Integer192Bit {
......
......@@ -11,7 +11,9 @@
// in the LICENSE file.
import Foundation
#if ATBUILD
import CSodium
#endif
extension Key {
/**Encrypts the receiver to another public key, from another secret key.
......
......@@ -11,6 +11,9 @@
// inthe LICENSE file.
import Foundation
#if ATBUILD
import CSodium
#endif
extension Key {
/**Saves the key to the file indicated.
......
......@@ -9,7 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// inthe LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
extension Key {
......
......@@ -9,7 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
/**A secure key storage class.
......
......@@ -9,7 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
public final class PublicKey {
public let bytes : [UInt8]
......
......@@ -9,6 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
public func sodium_random(size: Int) -> [UInt8] {
......
......@@ -11,6 +11,9 @@
// in the LICENSE file.
import Foundation
#if ATBUILD
import CSodium
#endif
func sodium_init_wrap() {
struct Static {
......
......@@ -11,6 +11,9 @@
// inthe LICENSE file.
import Foundation
#if ATBUILD
import CSodium
#endif
public func crypto_box_nonce() -> Integer192Bit {
return Integer192Bit(random: true)
......
......@@ -12,6 +12,10 @@
import Foundation
#if ATBUILD
import CSodium
#endif
public let crypto_secretbox_NONCESIZE = Int(crypto_secretbox_NONCEBYTES)
/**This is like crypto_secretbox, but it appends the nonce to the end of the ciphertext
......
......@@ -9,7 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
public let crypto_stream_chacha20_NONCESIZE = Int(crypto_stream_chacha20_NONCEBYTES)
......
......@@ -9,7 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
extension Array {
......
......@@ -9,6 +9,9 @@
// No part of NaOH, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
#if ATBUILD
import CSodium
#endif
import Foundation
......
(package
:name "NaOH"
:tasks {
:libsodium {
:tool "shell"
:script "./libsodium/build.sh"
}
:default {
:tool "atllbuild"
:source ["NaOH/**.swift"]
:name "NaOH"
:outputType "static-library"
:dependencies ["libsodium"]
:compileOptions ["-I" "libsodium/"]
}
}
)
#!/bin/bash
cd libsodium
if [ ! -f libsodium.tar.gz ]; then
curl -L https://github.com/jedisct1/libsodium/releases/download/1.0.7/libsodium-1.0.7.tar.gz -o libsodium.tar.gz
fi
if [ ! -f libsodium ]; then
mkdir -p libsodium
tar xf libsodium.tar.gz -C libsodium --strip-components=1
fi
cd libsodium
if [ ! -f Makefile ]; then
./configure
fi
if [ ! -f src/libsodium/.libs/libsodium.a ]; then
make -j8
fi
module CSodium [system] {
header "libsodium/src/libsodium/include/sodium.h"
link "sodium"
export *
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment