修复mico-sdk错误

This commit is contained in:
nhkefus
2025-03-11 15:54:45 +08:00
parent 3422912129
commit 2ccb892a1c
2152 changed files with 664341 additions and 702636 deletions

View File

@@ -1,22 +1,22 @@
#
# UNPUBLISHED PROPRIETARY SOURCE CODE
# Copyright (c) 2016 MXCHIP Inc.
#
# The contents of this file may not be disclosed to third parties, copied or
# duplicated in any form, in whole or in part, without the prior written
# permission of MXCHIP Corporation.
#
NAME := Lib_MiCO_Security_Sodium
GLOBAL_INCLUDES := inc
#SRP-6a
ifneq ($(wildcard $(CURDIR)Lib_Sodium.$(HOST_ARCH).$(TOOLCHAIN_NAME).release.a),)
$(NAME)_PREBUILT_LIBRARY := Lib_Sodium.$(HOST_ARCH).$(TOOLCHAIN_NAME).release.a
else
# Build from source
include $(CURDIR)Sodium_src.mk
endif
#
# UNPUBLISHED PROPRIETARY SOURCE CODE
# Copyright (c) 2016 MXCHIP Inc.
#
# The contents of this file may not be disclosed to third parties, copied or
# duplicated in any form, in whole or in part, without the prior written
# permission of MXCHIP Corporation.
#
NAME := Lib_MiCO_Security_Sodium
GLOBAL_INCLUDES := inc
#SRP-6a
ifneq ($(wildcard $(CURDIR)Lib_Sodium.$(HOST_ARCH).$(TOOLCHAIN_NAME).release.a),)
$(NAME)_PREBUILT_LIBRARY := Lib_Sodium.$(HOST_ARCH).$(TOOLCHAIN_NAME).release.a
else
# Build from source
include $(CURDIR)Sodium_src.mk
endif

0
mico-os/MiCO/security/Sodium/inc/Makefile.am Executable file → Normal file
View File

0
mico-os/MiCO/security/Sodium/inc/sodium.h Executable file → Normal file
View File

0
mico-os/MiCO/security/Sodium/inc/sodium/core.h Executable file → Normal file
View File

View File

@@ -1,56 +1,56 @@
#ifndef crypto_aead_chacha20poly1305_H
#define crypto_aead_chacha20poly1305_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_aead_chacha20poly1305_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_keybytes(void);
#define crypto_aead_chacha20poly1305_NSECBYTES 0U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_nsecbytes(void);
#define crypto_aead_chacha20poly1305_NPUBBYTES 8U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_npubbytes(void);
#define crypto_aead_chacha20poly1305_ABYTES 16U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_abytes(void);
SODIUM_EXPORT
int crypto_aead_chacha20poly1305_encrypt(unsigned char *c,
unsigned long long *clen,
const unsigned char *m,
unsigned long long mlen,
const unsigned char *ad,
unsigned long long adlen,
const unsigned char *nsec,
const unsigned char *npub,
const unsigned char *k);
SODIUM_EXPORT
int crypto_aead_chacha20poly1305_decrypt(unsigned char *m,
unsigned long long *mlen,
unsigned char *nsec,
const unsigned char *c,
unsigned long long clen,
const unsigned char *ad,
unsigned long long adlen,
const unsigned char *npub,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_aead_chacha20poly1305_H
#define crypto_aead_chacha20poly1305_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_aead_chacha20poly1305_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_keybytes(void);
#define crypto_aead_chacha20poly1305_NSECBYTES 0U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_nsecbytes(void);
#define crypto_aead_chacha20poly1305_NPUBBYTES 8U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_npubbytes(void);
#define crypto_aead_chacha20poly1305_ABYTES 16U
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_abytes(void);
SODIUM_EXPORT
int crypto_aead_chacha20poly1305_encrypt(unsigned char *c,
unsigned long long *clen,
const unsigned char *m,
unsigned long long mlen,
const unsigned char *ad,
unsigned long long adlen,
const unsigned char *nsec,
const unsigned char *npub,
const unsigned char *k);
SODIUM_EXPORT
int crypto_aead_chacha20poly1305_decrypt(unsigned char *m,
unsigned long long *mlen,
unsigned char *nsec,
const unsigned char *c,
unsigned long long clen,
const unsigned char *ad,
unsigned long long adlen,
const unsigned char *npub,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif

0
mico-os/MiCO/security/Sodium/inc/sodium/crypto_auth.h Executable file → Normal file
View File

View File

View File

View File

0
mico-os/MiCO/security/Sodium/inc/sodium/crypto_box.h Executable file → Normal file
View File

View File

View File

View File

View File

View File

View File

0
mico-os/MiCO/security/Sodium/inc/sodium/crypto_hash.h Executable file → Normal file
View File

View File

View File

0
mico-os/MiCO/security/Sodium/inc/sodium/crypto_int32.h Executable file → Normal file
View File

0
mico-os/MiCO/security/Sodium/inc/sodium/crypto_int64.h Executable file → Normal file
View File

View File

@@ -1,56 +1,56 @@
#ifndef crypto_onetimeauth_H
#define crypto_onetimeauth_H
#include <stddef.h>
#include "crypto_onetimeauth_poly1305.h"
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state;
#define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES
SODIUM_EXPORT
size_t crypto_onetimeauth_bytes(void);
#define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES
SODIUM_EXPORT
size_t crypto_onetimeauth_keybytes(void);
#define crypto_onetimeauth_PRIMITIVE "poly1305"
SODIUM_EXPORT
const char *crypto_onetimeauth_primitive(void);
SODIUM_EXPORT
int crypto_onetimeauth(unsigned char *out, const unsigned char *in,
unsigned long long inlen, const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
unsigned long long inlen, const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_init(crypto_onetimeauth_state *state,
const unsigned char *key);
SODIUM_EXPORT
int crypto_onetimeauth_update(crypto_onetimeauth_state *state,
const unsigned char *in,
unsigned long long inlen);
SODIUM_EXPORT
int crypto_onetimeauth_final(crypto_onetimeauth_state *state,
unsigned char *out);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_onetimeauth_H
#define crypto_onetimeauth_H
#include <stddef.h>
#include "crypto_onetimeauth_poly1305.h"
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state;
#define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES
SODIUM_EXPORT
size_t crypto_onetimeauth_bytes(void);
#define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES
SODIUM_EXPORT
size_t crypto_onetimeauth_keybytes(void);
#define crypto_onetimeauth_PRIMITIVE "poly1305"
SODIUM_EXPORT
const char *crypto_onetimeauth_primitive(void);
SODIUM_EXPORT
int crypto_onetimeauth(unsigned char *out, const unsigned char *in,
unsigned long long inlen, const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
unsigned long long inlen, const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_init(crypto_onetimeauth_state *state,
const unsigned char *key);
SODIUM_EXPORT
int crypto_onetimeauth_update(crypto_onetimeauth_state *state,
const unsigned char *in,
unsigned long long inlen);
SODIUM_EXPORT
int crypto_onetimeauth_final(crypto_onetimeauth_state *state,
unsigned char *out);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,88 +1,88 @@
#ifndef crypto_onetimeauth_poly1305_H
#define crypto_onetimeauth_poly1305_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#include <stdint.h>
#include <stdio.h>
typedef struct crypto_onetimeauth_poly1305_state {
unsigned long long aligner;
unsigned char opaque[136];
} crypto_onetimeauth_poly1305_state;
typedef struct crypto_onetimeauth_poly1305_implementation {
const char *(*implementation_name)(void);
int (*onetimeauth)(unsigned char *out,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
int (*onetimeauth_verify)(const unsigned char *h,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
int (*onetimeauth_init)(crypto_onetimeauth_poly1305_state *state,
const unsigned char *key);
int (*onetimeauth_update)(crypto_onetimeauth_poly1305_state *state,
const unsigned char *in,
unsigned long long inlen);
int (*onetimeauth_final)(crypto_onetimeauth_poly1305_state *state,
unsigned char *out);
} crypto_onetimeauth_poly1305_implementation;
#define crypto_onetimeauth_poly1305_BYTES 16U
SODIUM_EXPORT
size_t crypto_onetimeauth_poly1305_bytes(void);
#define crypto_onetimeauth_poly1305_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_onetimeauth_poly1305_keybytes(void);
SODIUM_EXPORT
const char *crypto_onetimeauth_poly1305_implementation_name(void);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_set_implementation(crypto_onetimeauth_poly1305_implementation *impl);
SODIUM_EXPORT
crypto_onetimeauth_poly1305_implementation *
crypto_onetimeauth_pick_best_implementation(void);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305(unsigned char *out,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
const unsigned char *key);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
const unsigned char *in,
unsigned long long inlen);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
unsigned char *out);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_onetimeauth_poly1305_H
#define crypto_onetimeauth_poly1305_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#include <stdint.h>
#include <stdio.h>
typedef struct crypto_onetimeauth_poly1305_state {
unsigned long long aligner;
unsigned char opaque[136];
} crypto_onetimeauth_poly1305_state;
typedef struct crypto_onetimeauth_poly1305_implementation {
const char *(*implementation_name)(void);
int (*onetimeauth)(unsigned char *out,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
int (*onetimeauth_verify)(const unsigned char *h,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
int (*onetimeauth_init)(crypto_onetimeauth_poly1305_state *state,
const unsigned char *key);
int (*onetimeauth_update)(crypto_onetimeauth_poly1305_state *state,
const unsigned char *in,
unsigned long long inlen);
int (*onetimeauth_final)(crypto_onetimeauth_poly1305_state *state,
unsigned char *out);
} crypto_onetimeauth_poly1305_implementation;
#define crypto_onetimeauth_poly1305_BYTES 16U
SODIUM_EXPORT
size_t crypto_onetimeauth_poly1305_bytes(void);
#define crypto_onetimeauth_poly1305_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_onetimeauth_poly1305_keybytes(void);
SODIUM_EXPORT
const char *crypto_onetimeauth_poly1305_implementation_name(void);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_set_implementation(crypto_onetimeauth_poly1305_implementation *impl);
SODIUM_EXPORT
crypto_onetimeauth_poly1305_implementation *
crypto_onetimeauth_pick_best_implementation(void);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305(unsigned char *out,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
const unsigned char *key);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
const unsigned char *in,
unsigned long long inlen);
SODIUM_EXPORT
int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
unsigned char *out);
#ifdef __cplusplus
}
#endif
#endif

View File

View File

View File

View File

View File

130
mico-os/MiCO/security/Sodium/inc/sodium/crypto_sign.h Executable file → Normal file
View File

@@ -1,65 +1,65 @@
#ifndef crypto_sign_H
#define crypto_sign_H
/*
* THREAD SAFETY: crypto_sign_keypair() is thread-safe,
* provided that you called sodium_init() once before using any
* other libsodium function.
* Other functions, including crypto_sign_seed_keypair() are always thread-safe.
*/
#include <stddef.h>
#include "crypto_sign_ed25519.h"
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_sign_BYTES crypto_sign_ed25519_BYTES
SODIUM_EXPORT
size_t crypto_sign_bytes(void);
#define crypto_sign_SEEDBYTES crypto_sign_ed25519_SEEDBYTES
SODIUM_EXPORT
size_t crypto_sign_seedbytes(void);
#define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES
SODIUM_EXPORT
size_t crypto_sign_publickeybytes(void);
#define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES
SODIUM_EXPORT
size_t crypto_sign_secretkeybytes(void);
#define crypto_sign_PRIMITIVE "ed25519"
SODIUM_EXPORT
const char *crypto_sign_primitive(void);
SODIUM_EXPORT
int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
const unsigned char *seed);
SODIUM_EXPORT
int crypto_sign_keypair(unsigned char *pk, unsigned char *sk);
SODIUM_EXPORT
int crypto_sign(unsigned char *sm, unsigned long long *smlen,
const unsigned char *m, unsigned long long mlen,
const unsigned char *sk);
SODIUM_EXPORT
int crypto_sign_open(unsigned char *m, unsigned long long *mlen,
const unsigned char *sm, unsigned long long smlen,
const unsigned char *pk);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_sign_H
#define crypto_sign_H
/*
* THREAD SAFETY: crypto_sign_keypair() is thread-safe,
* provided that you called sodium_init() once before using any
* other libsodium function.
* Other functions, including crypto_sign_seed_keypair() are always thread-safe.
*/
#include <stddef.h>
#include "crypto_sign_ed25519.h"
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_sign_BYTES crypto_sign_ed25519_BYTES
SODIUM_EXPORT
size_t crypto_sign_bytes(void);
#define crypto_sign_SEEDBYTES crypto_sign_ed25519_SEEDBYTES
SODIUM_EXPORT
size_t crypto_sign_seedbytes(void);
#define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES
SODIUM_EXPORT
size_t crypto_sign_publickeybytes(void);
#define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES
SODIUM_EXPORT
size_t crypto_sign_secretkeybytes(void);
#define crypto_sign_PRIMITIVE "ed25519"
SODIUM_EXPORT
const char *crypto_sign_primitive(void);
SODIUM_EXPORT
int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
const unsigned char *seed);
SODIUM_EXPORT
int crypto_sign_keypair(unsigned char *pk, unsigned char *sk);
SODIUM_EXPORT
int crypto_sign(unsigned char *sm, unsigned long long *smlen,
const unsigned char *m, unsigned long long mlen,
const unsigned char *sk);
SODIUM_EXPORT
int crypto_sign_open(unsigned char *m, unsigned long long *mlen,
const unsigned char *sm, unsigned long long smlen,
const unsigned char *pk);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,52 +1,52 @@
#ifndef crypto_sign_ed25519_H
#define crypto_sign_ed25519_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_sign_ed25519_BYTES 64U
SODIUM_EXPORT
size_t crypto_sign_ed25519_bytes(void);
#define crypto_sign_ed25519_SEEDBYTES 32U
SODIUM_EXPORT
size_t crypto_sign_ed25519_seedbytes(void);
#define crypto_sign_ed25519_PUBLICKEYBYTES 32U
SODIUM_EXPORT
size_t crypto_sign_ed25519_publickeybytes(void);
#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U)
SODIUM_EXPORT
size_t crypto_sign_ed25519_secretkeybytes(void);
SODIUM_EXPORT
int crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen,
const unsigned char *m, unsigned long long mlen,
const unsigned char *sk);
SODIUM_EXPORT
int crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen,
const unsigned char *sm, unsigned long long smlen,
const unsigned char *pk);
SODIUM_EXPORT
int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk);
SODIUM_EXPORT
int crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk,
const unsigned char *seed);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_sign_ed25519_H
#define crypto_sign_ed25519_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_sign_ed25519_BYTES 64U
SODIUM_EXPORT
size_t crypto_sign_ed25519_bytes(void);
#define crypto_sign_ed25519_SEEDBYTES 32U
SODIUM_EXPORT
size_t crypto_sign_ed25519_seedbytes(void);
#define crypto_sign_ed25519_PUBLICKEYBYTES 32U
SODIUM_EXPORT
size_t crypto_sign_ed25519_publickeybytes(void);
#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U)
SODIUM_EXPORT
size_t crypto_sign_ed25519_secretkeybytes(void);
SODIUM_EXPORT
int crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen,
const unsigned char *m, unsigned long long mlen,
const unsigned char *sk);
SODIUM_EXPORT
int crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen,
const unsigned char *sm, unsigned long long smlen,
const unsigned char *pk);
SODIUM_EXPORT
int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk);
SODIUM_EXPORT
int crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk,
const unsigned char *seed);
#ifdef __cplusplus
}
#endif
#endif

100
mico-os/MiCO/security/Sodium/inc/sodium/crypto_stream.h Executable file → Normal file
View File

@@ -1,50 +1,50 @@
#ifndef crypto_stream_H
#define crypto_stream_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include "crypto_stream_xsalsa20.h"
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES
SODIUM_EXPORT
size_t crypto_stream_keybytes(void);
#define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES
SODIUM_EXPORT
size_t crypto_stream_noncebytes(void);
#define crypto_stream_PRIMITIVE "xsalsa20"
SODIUM_EXPORT
const char *crypto_stream_primitive(void);
SODIUM_EXPORT
int crypto_stream(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_stream_H
#define crypto_stream_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include "crypto_stream_xsalsa20.h"
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES
SODIUM_EXPORT
size_t crypto_stream_keybytes(void);
#define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES
SODIUM_EXPORT
size_t crypto_stream_noncebytes(void);
#define crypto_stream_PRIMITIVE "xsalsa20"
SODIUM_EXPORT
const char *crypto_stream_primitive(void);
SODIUM_EXPORT
int crypto_stream(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif

View File

View File

View File

@@ -1,50 +1,50 @@
#ifndef crypto_stream_chacha20_H
#define crypto_stream_chacha20_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_chacha20_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_chacha20_keybytes(void);
#define crypto_stream_chacha20_NONCEBYTES 8U
SODIUM_EXPORT
size_t crypto_stream_chacha20_noncebytes(void);
SODIUM_EXPORT
int crypto_stream_chacha20(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
unsigned long long mlen,
const unsigned char *n, uint64_t ic,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_stream_chacha20_H
#define crypto_stream_chacha20_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_chacha20_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_chacha20_keybytes(void);
#define crypto_stream_chacha20_NONCEBYTES 8U
SODIUM_EXPORT
size_t crypto_stream_chacha20_noncebytes(void);
SODIUM_EXPORT
int crypto_stream_chacha20(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
unsigned long long mlen,
const unsigned char *n, uint64_t ic,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif

View File

View File

View File

View File

@@ -1,44 +1,44 @@
#ifndef crypto_stream_xsalsa20_H
#define crypto_stream_xsalsa20_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_xsalsa20_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_keybytes(void);
#define crypto_stream_xsalsa20_NONCEBYTES 24U
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_noncebytes(void);
SODIUM_EXPORT
int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_xsalsa20_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_stream_xsalsa20_H
#define crypto_stream_xsalsa20_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_xsalsa20_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_keybytes(void);
#define crypto_stream_xsalsa20_NONCEBYTES 24U
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_noncebytes(void);
SODIUM_EXPORT
int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_xsalsa20_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
#ifdef __cplusplus
}
#endif
#endif

View File

View File

View File

0
mico-os/MiCO/security/Sodium/inc/sodium/crypto_uint8.h Executable file → Normal file
View File

View File

@@ -1,23 +1,23 @@
#ifndef crypto_verify_16_H
#define crypto_verify_16_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#define crypto_verify_16_BYTES 16U
SODIUM_EXPORT
size_t crypto_verify_16_bytes(void);
SODIUM_EXPORT
int crypto_verify_16(const unsigned char *x, const unsigned char *y);
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_verify_16_H
#define crypto_verify_16_H
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#define crypto_verify_16_BYTES 16U
SODIUM_EXPORT
size_t crypto_verify_16_bytes(void);
SODIUM_EXPORT
int crypto_verify_16(const unsigned char *x, const unsigned char *y);
#ifdef __cplusplus
}
#endif
#endif

View File

View File

66
mico-os/MiCO/security/Sodium/inc/sodium/export.h Executable file → Normal file
View File

@@ -1,33 +1,33 @@
#ifndef __SODIUM_EXPORT_H__
#define __SODIUM_EXPORT_H__
#ifndef __GNUC__
# ifdef __attribute__
# undef __attribute__
# endif
# define __attribute__(a)
#endif
#ifdef SODIUM_STATIC
# define SODIUM_EXPORT
#else
# if defined(_MSC_VER)
# ifdef DLL_EXPORT
# define SODIUM_EXPORT __declspec(dllexport)
# else
# define SODIUM_EXPORT __declspec(dllimport)
# endif
# else
# if defined(__SUNPRO_C)
# define SODIUM_EXPORT __attribute__ __global
# elif defined(_MSG_VER)
# define SODIUM_EXPORT extern __declspec(dllexport)
# else
# define SODIUM_EXPORT __attribute__ ((visibility ("default")))
# endif
# endif
#endif
#endif
#ifndef __SODIUM_EXPORT_H__
#define __SODIUM_EXPORT_H__
#ifndef __GNUC__
# ifdef __attribute__
# undef __attribute__
# endif
# define __attribute__(a)
#endif
#ifdef SODIUM_STATIC
# define SODIUM_EXPORT
#else
# if defined(_MSC_VER)
# ifdef DLL_EXPORT
# define SODIUM_EXPORT __declspec(dllexport)
# else
# define SODIUM_EXPORT __declspec(dllimport)
# endif
# else
# if defined(__SUNPRO_C)
# define SODIUM_EXPORT __attribute__ __global
# elif defined(_MSG_VER)
# define SODIUM_EXPORT extern __declspec(dllexport)
# else
# define SODIUM_EXPORT __attribute__ ((visibility ("default")))
# endif
# endif
#endif
#endif

108
mico-os/MiCO/security/Sodium/inc/sodium/randombytes.h Executable file → Normal file
View File

@@ -1,54 +1,54 @@
#ifndef randombytes_H
#define randombytes_H
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
typedef struct randombytes_implementation {
const char *(*implementation_name)(void);
uint32_t (*random)(void);
void (*stir)(void);
uint32_t (*uniform)(const uint32_t upper_bound);
void (*buf)(void * const buf, const size_t size);
int (*close)(void);
} randombytes_implementation;
SODIUM_EXPORT
int randombytes_set_implementation(randombytes_implementation *impl);
SODIUM_EXPORT
void randombytes(unsigned char * const buf, const unsigned long long buf_len);
SODIUM_EXPORT
const char *randombytes_implementation_name(void);
SODIUM_EXPORT
uint32_t randombytes_random(void);
SODIUM_EXPORT
void randombytes_stir(void);
SODIUM_EXPORT
uint32_t randombytes_uniform(const uint32_t upper_bound);
SODIUM_EXPORT
void randombytes_buf(void * const buf, const size_t size);
SODIUM_EXPORT
int randombytes_close(void);
#ifdef __cplusplus
}
#endif
#endif
#ifndef randombytes_H
#define randombytes_H
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#ifdef __cplusplus
# if __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
typedef struct randombytes_implementation {
const char *(*implementation_name)(void);
uint32_t (*random)(void);
void (*stir)(void);
uint32_t (*uniform)(const uint32_t upper_bound);
void (*buf)(void * const buf, const size_t size);
int (*close)(void);
} randombytes_implementation;
SODIUM_EXPORT
int randombytes_set_implementation(randombytes_implementation *impl);
SODIUM_EXPORT
void randombytes(unsigned char * const buf, const unsigned long long buf_len);
SODIUM_EXPORT
const char *randombytes_implementation_name(void);
SODIUM_EXPORT
uint32_t randombytes_random(void);
SODIUM_EXPORT
void randombytes_stir(void);
SODIUM_EXPORT
uint32_t randombytes_uniform(const uint32_t upper_bound);
SODIUM_EXPORT
void randombytes_buf(void * const buf, const size_t size);
SODIUM_EXPORT
int randombytes_close(void);
#ifdef __cplusplus
}
#endif
#endif

View File

View File

@@ -1,46 +1,46 @@
#ifndef randombytes_sysrandom_H
#define randombytes_sysrandom_H
/*
* THREAD SAFETY: randombytes_sysrandom() functions are thread-safe,
* provided that you called sodium_init() once before using any
* other libsodium function.
*/
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
SODIUM_EXPORT
extern struct randombytes_implementation randombytes_sysrandom_implementation;
SODIUM_EXPORT
const char *randombytes_sysrandom_implementation_name(void);
SODIUM_EXPORT
uint32_t randombytes_sysrandom(void);
SODIUM_EXPORT
void randombytes_sysrandom_stir(void);
SODIUM_EXPORT
uint32_t randombytes_sysrandom_uniform(const uint32_t upper_bound);
SODIUM_EXPORT
void randombytes_sysrandom_buf(void * const buf, const size_t size);
SODIUM_EXPORT
int randombytes_sysrandom_close(void);
#ifdef __cplusplus
}
#endif
#endif
#ifndef randombytes_sysrandom_H
#define randombytes_sysrandom_H
/*
* THREAD SAFETY: randombytes_sysrandom() functions are thread-safe,
* provided that you called sodium_init() once before using any
* other libsodium function.
*/
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
SODIUM_EXPORT
extern struct randombytes_implementation randombytes_sysrandom_implementation;
SODIUM_EXPORT
const char *randombytes_sysrandom_implementation_name(void);
SODIUM_EXPORT
uint32_t randombytes_sysrandom(void);
SODIUM_EXPORT
void randombytes_sysrandom_stir(void);
SODIUM_EXPORT
uint32_t randombytes_sysrandom_uniform(const uint32_t upper_bound);
SODIUM_EXPORT
void randombytes_sysrandom_buf(void * const buf, const size_t size);
SODIUM_EXPORT
int randombytes_sysrandom_close(void);
#ifdef __cplusplus
}
#endif
#endif

0
mico-os/MiCO/security/Sodium/inc/sodium/runtime.h Executable file → Normal file
View File

98
mico-os/MiCO/security/Sodium/inc/sodium/utils.h Executable file → Normal file
View File

@@ -1,49 +1,49 @@
#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# define _SODIUM_C99(X)
#else
# define _SODIUM_C99(X) X
#endif
unsigned char *_sodium_alignedcalloc(unsigned char ** const unaligned_p,
const size_t len);
SODIUM_EXPORT
void sodium_memzero(void * const pnt, const size_t len);
SODIUM_EXPORT
int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len);
SODIUM_EXPORT
char *sodium_bin2hex(char * const hex, const size_t hex_maxlen,
const unsigned char * const bin, const size_t bin_len);
SODIUM_EXPORT
int sodium_hex2bin(unsigned char * const bin, const size_t bin_maxlen,
const char * const hex, const size_t hex_len,
const char * const ignore, size_t * const bin_len,
const char ** const hex_end);
SODIUM_EXPORT
int sodium_mlock(void * const addr, const size_t len);
SODIUM_EXPORT
int sodium_munlock(void * const addr, const size_t len);
#ifdef __cplusplus
}
#endif
#endif
#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# define _SODIUM_C99(X)
#else
# define _SODIUM_C99(X) X
#endif
unsigned char *_sodium_alignedcalloc(unsigned char ** const unaligned_p,
const size_t len);
SODIUM_EXPORT
void sodium_memzero(void * const pnt, const size_t len);
SODIUM_EXPORT
int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len);
SODIUM_EXPORT
char *sodium_bin2hex(char * const hex, const size_t hex_maxlen,
const unsigned char * const bin, const size_t bin_len);
SODIUM_EXPORT
int sodium_hex2bin(unsigned char * const bin, const size_t bin_maxlen,
const char * const hex, const size_t hex_len,
const char * const ignore, size_t * const bin_len,
const char ** const hex_end);
SODIUM_EXPORT
int sodium_mlock(void * const addr, const size_t len);
SODIUM_EXPORT
int sodium_munlock(void * const addr, const size_t len);
#ifdef __cplusplus
}
#endif
#endif

0
mico-os/MiCO/security/Sodium/inc/sodium/version.h Executable file → Normal file
View File