Skip to content

Commit

Permalink
update ant build triggered by the kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
AionJayT committed Aug 21, 2018
1 parent 0905102 commit f63a708
Show file tree
Hide file tree
Showing 137 changed files with 680 additions and 105 deletions.
12 changes: 12 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<property name="test.report.dir" value="report" />
<property name="dir.pack" value="pack" />
<property name="dir.docs" value="docs" />
<property name="dir.native" value="native/linux" />
<property name="dir.kernel.mod" value="../mod" />
<property name="dir.kernel.native" value="../native/linux" />


<!-- Paths -->
Expand Down Expand Up @@ -132,6 +134,16 @@
</target>

<target name="clean_build_from_kernel">
<copy todir="${dir.native}/zmq" overwrite="true" >
<fileset dir="${dir.kernel.native}/zmq"/>
</copy>
<copy todir="${dir.native}/sodium" overwrite="true" >
<fileset dir="${dir.kernel.native}/sodium"/>
</copy>
<copy todir="${dir.native}/blake2b" overwrite="true" >
<fileset dir="${dir.kernel.native}/blake2b"/>
</copy>

<copy file="${dir.kernel.mod}/modAionBase.jar" todir="${dir.modfile}" overwrite="true" />
<copy file="${dir.kernel.mod}/modCrypto.jar" todir="${dir.modfile}" overwrite="true" />
<copy file="${dir.kernel.mod}/modLogger.jar" todir="${dir.modfile}" overwrite="true" />
Expand Down
Empty file modified native/linux/blake2b/file.list
100644 → 100755
Empty file.
Binary file modified native/linux/blake2b/libblake2b.so
Binary file not shown.
Empty file modified native/linux/sodium/file.list
100644 → 100755
Empty file.
Binary file modified native/linux/sodium/libsodium.so
Binary file not shown.
Binary file modified native/linux/sodium/libsodiumjni.so
Binary file not shown.
6 changes: 4 additions & 2 deletions native/linux/sodium/sodium.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
#include "sodium/crypto_onetimeauth_poly1305.h"
#include "sodium/crypto_pwhash.h"
#include "sodium/crypto_pwhash_argon2i.h"
#include "sodium/crypto_pwhash_scryptsalsa208sha256.h"
#include "sodium/crypto_scalarmult.h"
#include "sodium/crypto_scalarmult_curve25519.h"
#include "sodium/crypto_secretbox.h"
#include "sodium/crypto_secretbox_xsalsa20poly1305.h"
#include "sodium/crypto_secretstream_xchacha20poly1305.h"
#include "sodium/crypto_shorthash.h"
#include "sodium/crypto_shorthash_siphash24.h"
#include "sodium/crypto_sign.h"
Expand All @@ -58,8 +58,10 @@

#ifndef SODIUM_LIBRARY_MINIMAL
# include "sodium/crypto_box_curve25519xchacha20poly1305.h"
# include "sodium/crypto_core_ed25519.h"
# include "sodium/crypto_scalarmult_ed25519.h"
# include "sodium/crypto_secretbox_xchacha20poly1305.h"
# include "sodium/crypto_stream_aes128ctr.h"
# include "sodium/crypto_pwhash_scryptsalsa208sha256.h"
# include "sodium/crypto_stream_salsa2012.h"
# include "sodium/crypto_stream_salsa208.h"
# include "sodium/crypto_stream_xchacha20.h"
Expand Down
9 changes: 9 additions & 0 deletions native/linux/sodium/sodium/core.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ SODIUM_EXPORT
int sodium_init(void)
__attribute__ ((warn_unused_result));

/* ---- */

SODIUM_EXPORT
int sodium_set_misuse_handler(void (*handler)(void));

SODIUM_EXPORT
void sodium_misuse(void)
__attribute__ ((noreturn));

#ifdef __cplusplus
}
#endif
Expand Down
26 changes: 26 additions & 0 deletions native/linux/sodium/sodium/crypto_aead_aes256gcm.h
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#ifndef crypto_aead_aes256gcm_H
#define crypto_aead_aes256gcm_H

/*
* WARNING: Despite being the most popular AEAD construction due to its
* use in TLS, safely using AES-GCM in a different context is tricky.
*
* No more than ~ 350 GB of input data should be encrypted with a given key.
* This is for ~ 16 KB messages -- Actual figures vary according to
* message sizes.
*
* In addition, nonces are short and repeated nonces would totally destroy
* the security of this scheme.
*
* Nonces should thus come from atomic counters, which can be difficult to
* set up in a distributed environment.
*
* Unless you absolutely need AES-GCM, use crypto_aead_xchacha20poly1305_ietf_*()
* instead. It doesn't have any of these limitations.
* Or, if you don't need to authenticate additional data, just stick to
* crypto_secretbox().
*/

#include <stddef.h>
#include "export.h"

Expand Down Expand Up @@ -30,6 +50,12 @@ size_t crypto_aead_aes256gcm_npubbytes(void);
SODIUM_EXPORT
size_t crypto_aead_aes256gcm_abytes(void);

#define crypto_aead_aes256gcm_MESSAGEBYTES_MAX \
SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_aes256gcm_ABYTES, \
(16ULL * ((1ULL << 32) - 2ULL)) - crypto_aead_aes256gcm_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_aes256gcm_messagebytes_max(void);

typedef CRYPTO_ALIGN(16) unsigned char crypto_aead_aes256gcm_state[512];

SODIUM_EXPORT
Expand Down
20 changes: 16 additions & 4 deletions native/linux/sodium/sodium/crypto_aead_chacha20poly1305.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ size_t crypto_aead_chacha20poly1305_ietf_npubbytes(void);
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_ietf_abytes(void);

#define crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX \
SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_chacha20poly1305_ietf_ABYTES, \
(64ULL * (1ULL << 32) - 64ULL) - crypto_aead_chacha20poly1305_ietf_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_ietf_messagebytes_max(void);

SODIUM_EXPORT
int crypto_aead_chacha20poly1305_ietf_encrypt(unsigned char *c,
unsigned long long *clen_p,
Expand Down Expand Up @@ -98,6 +104,11 @@ size_t crypto_aead_chacha20poly1305_npubbytes(void);
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_abytes(void);

#define crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX \
(SODIUM_SIZE_MAX - crypto_aead_chacha20poly1305_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_messagebytes_max(void);

SODIUM_EXPORT
int crypto_aead_chacha20poly1305_encrypt(unsigned char *c,
unsigned long long *clen_p,
Expand Down Expand Up @@ -150,10 +161,11 @@ void crypto_aead_chacha20poly1305_keygen(unsigned char k[crypto_aead_chacha20pol

/* Aliases */

#define crypto_aead_chacha20poly1305_IETF_KEYBYTES crypto_aead_chacha20poly1305_ietf_KEYBYTES
#define crypto_aead_chacha20poly1305_IETF_NSECBYTES crypto_aead_chacha20poly1305_ietf_NSECBYTES
#define crypto_aead_chacha20poly1305_IETF_NPUBBYTES crypto_aead_chacha20poly1305_ietf_NPUBBYTES
#define crypto_aead_chacha20poly1305_IETF_ABYTES crypto_aead_chacha20poly1305_ietf_ABYTES
#define crypto_aead_chacha20poly1305_IETF_KEYBYTES crypto_aead_chacha20poly1305_ietf_KEYBYTES
#define crypto_aead_chacha20poly1305_IETF_NSECBYTES crypto_aead_chacha20poly1305_ietf_NSECBYTES
#define crypto_aead_chacha20poly1305_IETF_NPUBBYTES crypto_aead_chacha20poly1305_ietf_NPUBBYTES
#define crypto_aead_chacha20poly1305_IETF_ABYTES crypto_aead_chacha20poly1305_ietf_ABYTES
#define crypto_aead_chacha20poly1305_IETF_MESSAGEBYTES_MAX crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX

#ifdef __cplusplus
}
Expand Down
14 changes: 10 additions & 4 deletions native/linux/sodium/sodium/crypto_aead_xchacha20poly1305.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ size_t crypto_aead_xchacha20poly1305_ietf_npubbytes(void);
SODIUM_EXPORT
size_t crypto_aead_xchacha20poly1305_ietf_abytes(void);

#define crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX \
(SODIUM_SIZE_MAX - crypto_aead_xchacha20poly1305_ietf_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_xchacha20poly1305_ietf_messagebytes_max(void);

SODIUM_EXPORT
int crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c,
unsigned long long *clen_p,
Expand Down Expand Up @@ -79,10 +84,11 @@ void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchac

/* Aliases */

#define crypto_aead_xchacha20poly1305_IETF_KEYBYTES crypto_aead_xchacha20poly1305_ietf_KEYBYTES
#define crypto_aead_xchacha20poly1305_IETF_NSECBYTES crypto_aead_xchacha20poly1305_ietf_NSECBYTES
#define crypto_aead_xchacha20poly1305_IETF_NPUBBYTES crypto_aead_xchacha20poly1305_ietf_NPUBBYTES
#define crypto_aead_xchacha20poly1305_IETF_ABYTES crypto_aead_xchacha20poly1305_ietf_ABYTES
#define crypto_aead_xchacha20poly1305_IETF_KEYBYTES crypto_aead_xchacha20poly1305_ietf_KEYBYTES
#define crypto_aead_xchacha20poly1305_IETF_NSECBYTES crypto_aead_xchacha20poly1305_ietf_NSECBYTES
#define crypto_aead_xchacha20poly1305_IETF_NPUBBYTES crypto_aead_xchacha20poly1305_ietf_NPUBBYTES
#define crypto_aead_xchacha20poly1305_IETF_ABYTES crypto_aead_xchacha20poly1305_ietf_ABYTES
#define crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX

#ifdef __cplusplus
}
Expand Down
Empty file modified native/linux/sodium/sodium/crypto_auth.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_auth_hmacsha256.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_auth_hmacsha512.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_auth_hmacsha512256.h
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions native/linux/sodium/sodium/crypto_box.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ size_t crypto_box_noncebytes(void);
SODIUM_EXPORT
size_t crypto_box_macbytes(void);

#define crypto_box_MESSAGEBYTES_MAX crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX
SODIUM_EXPORT
size_t crypto_box_messagebytes_max(void);

#define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305"
SODIUM_EXPORT
const char *crypto_box_primitive(void);
Expand Down
29 changes: 29 additions & 0 deletions native/linux/sodium/sodium/crypto_box_curve25519xchacha20poly1305.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define crypto_box_curve25519xchacha20poly1305_H

#include <stddef.h>
#include "crypto_stream_xchacha20.h"
#include "export.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -36,6 +37,11 @@ size_t crypto_box_curve25519xchacha20poly1305_noncebytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xchacha20poly1305_macbytes(void);

#define crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX \
(crypto_stream_xchacha20_MESSAGEBYTES_MAX - crypto_box_curve25519xchacha20poly1305_MACBYTES)
SODIUM_EXPORT
size_t crypto_box_curve25519xchacha20poly1305_messagebytes_max(void);

SODIUM_EXPORT
int crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char *pk,
unsigned char *sk,
Expand Down Expand Up @@ -123,6 +129,29 @@ int crypto_box_curve25519xchacha20poly1305_open_detached_afternm(unsigned char *
const unsigned char *k)
__attribute__ ((warn_unused_result));

/* -- Ephemeral SK interface -- */

#define crypto_box_curve25519xchacha20poly1305_SEALBYTES \
(crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES + \
crypto_box_curve25519xchacha20poly1305_MACBYTES)

SODIUM_EXPORT
size_t crypto_box_curve25519xchacha20poly1305_sealbytes(void);

SODIUM_EXPORT
int crypto_box_curve25519xchacha20poly1305_seal(unsigned char *c,
const unsigned char *m,
unsigned long long mlen,
const unsigned char *pk);

SODIUM_EXPORT
int crypto_box_curve25519xchacha20poly1305_seal_open(unsigned char *m,
const unsigned char *c,
unsigned long long clen,
const unsigned char *pk,
const unsigned char *sk)
__attribute__ ((warn_unused_result));

#ifdef __cplusplus
}
#endif
Expand Down
39 changes: 24 additions & 15 deletions native/linux/sodium/sodium/crypto_box_curve25519xsalsa20poly1305.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define crypto_box_curve25519xsalsa20poly1305_H

#include <stddef.h>
#include "crypto_stream_xsalsa20.h"
#include "export.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -35,6 +36,29 @@ size_t crypto_box_curve25519xsalsa20poly1305_noncebytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_macbytes(void);

/* Only for the libsodium API - The NaCl compatibility API would require BOXZEROBYTES extra bytes */
#define crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX \
(crypto_stream_xsalsa20_MESSAGEBYTES_MAX - crypto_box_curve25519xsalsa20poly1305_MACBYTES)
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_messagebytes_max(void);

SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_seed_keypair(unsigned char *pk,
unsigned char *sk,
const unsigned char *seed);

SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk,
unsigned char *sk);

SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k,
const unsigned char *pk,
const unsigned char *sk)
__attribute__ ((warn_unused_result));

/* -- NaCl compatibility interface ; Requires padding -- */

#define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void);
Expand Down Expand Up @@ -63,21 +87,6 @@ int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m,
const unsigned char *sk)
__attribute__ ((warn_unused_result));

SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_seed_keypair(unsigned char *pk,
unsigned char *sk,
const unsigned char *seed);

SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk,
unsigned char *sk);

SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k,
const unsigned char *pk,
const unsigned char *sk)
__attribute__ ((warn_unused_result));

SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c,
const unsigned char *m,
Expand Down
37 changes: 37 additions & 0 deletions native/linux/sodium/sodium/crypto_core_ed25519.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef crypto_core_ed25519_H
#define crypto_core_ed25519_H

#include <stddef.h>
#include "export.h"

#ifdef __cplusplus
extern "C" {
#endif

#define crypto_core_ed25519_BYTES 32
SODIUM_EXPORT
size_t crypto_core_ed25519_bytes(void);

#define crypto_core_ed25519_UNIFORMBYTES 32
SODIUM_EXPORT
size_t crypto_core_ed25519_uniformbytes(void);

SODIUM_EXPORT
int crypto_core_ed25519_is_valid_point(const unsigned char *p);

SODIUM_EXPORT
int crypto_core_ed25519_add(unsigned char *r,
const unsigned char *p, const unsigned char *q);

SODIUM_EXPORT
int crypto_core_ed25519_sub(unsigned char *r,
const unsigned char *p, const unsigned char *q);

SODIUM_EXPORT
int crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r);

#ifdef __cplusplus
}
#endif

#endif
Empty file modified native/linux/sodium/sodium/crypto_core_hchacha20.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_core_hsalsa20.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_core_salsa20.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_core_salsa2012.h
100644 → 100755
Empty file.
12 changes: 8 additions & 4 deletions native/linux/sodium/sodium/crypto_core_salsa208.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ extern "C" {

#define crypto_core_salsa208_OUTPUTBYTES 64U
SODIUM_EXPORT
size_t crypto_core_salsa208_outputbytes(void);
size_t crypto_core_salsa208_outputbytes(void)
__attribute__ ((deprecated));

#define crypto_core_salsa208_INPUTBYTES 16U
SODIUM_EXPORT
size_t crypto_core_salsa208_inputbytes(void);
size_t crypto_core_salsa208_inputbytes(void)
__attribute__ ((deprecated));

#define crypto_core_salsa208_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_core_salsa208_keybytes(void);
size_t crypto_core_salsa208_keybytes(void)
__attribute__ ((deprecated));

#define crypto_core_salsa208_CONSTBYTES 16U
SODIUM_EXPORT
size_t crypto_core_salsa208_constbytes(void);
size_t crypto_core_salsa208_constbytes(void)
__attribute__ ((deprecated));

SODIUM_EXPORT
int crypto_core_salsa208(unsigned char *out, const unsigned char *in,
Expand Down
Empty file modified native/linux/sodium/sodium/crypto_generichash.h
100644 → 100755
Empty file.
6 changes: 1 addition & 5 deletions native/linux/sodium/sodium/crypto_generichash_blake2b.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern "C" {
# pragma pack(push, 1)
#endif

typedef CRYPTO_ALIGN(64) struct crypto_generichash_blake2b_state {
typedef struct CRYPTO_ALIGN(64) crypto_generichash_blake2b_state {
uint64_t h[8];
uint64_t t[2];
uint64_t f[2];
Expand Down Expand Up @@ -110,10 +110,6 @@ int crypto_generichash_blake2b_final(crypto_generichash_blake2b_state *state,
SODIUM_EXPORT
void crypto_generichash_blake2b_keygen(unsigned char k[crypto_generichash_blake2b_KEYBYTES]);

/* ------------------------------------------------------------------------- */

int _crypto_generichash_blake2b_pick_best_implementation(void);

#ifdef __cplusplus
}
#endif
Expand Down
Empty file modified native/linux/sodium/sodium/crypto_hash.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_hash_sha256.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_hash_sha512.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_kdf.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_kdf_blake2b.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_kx.h
100644 → 100755
Empty file.
Empty file modified native/linux/sodium/sodium/crypto_onetimeauth.h
100644 → 100755
Empty file.
Loading

0 comments on commit f63a708

Please sign in to comment.