upload natives
parent
2506923178
commit
d41a45ba4e
|
@ -0,0 +1,21 @@
|
|||
project(TeaWeb-Native)
|
||||
|
||||
set(CMAKE_CXX_COMPILER "emcc")
|
||||
set(CMAKE_C_COMPILER "emcc")
|
||||
set(CMAKE_C_LINK_EXECUTABLE "emcc")
|
||||
set(CMAKE_CXX_FLAGS "-O3 --llvm-lto 1 --memory-init-file 0 -s WASM=1") #-s ASSERTIONS=2 -s ALLOW_MEMORY_GROWTH=1 -O3
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\", \"Pointer_stringify\"]'") #
|
||||
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/generated/")
|
||||
|
||||
include_directories(libraries/tommath/)
|
||||
include_directories(libraries/tomcrypt/src/headers)
|
||||
include_directories(libraries/opus/include/)
|
||||
add_definitions(-DLTM_DESC)
|
||||
|
||||
add_executable(TeaWeb-Identity.js identity/Identity.cpp identity/TeamSpeakIdentity.cpp)
|
||||
target_link_libraries(TeaWeb-Identity.js ${CMAKE_CURRENT_SOURCE_DIR}/libraries/tomcrypt/libtomcrypt.a ${CMAKE_CURRENT_SOURCE_DIR}/libraries/tommath/build/libtommathStatic.a)
|
||||
|
||||
add_executable(TeaWeb-Worker-Codec-Opus.js src/opus.cpp)
|
||||
target_link_libraries(TeaWeb-Worker-Codec-Opus.js ${CMAKE_CURRENT_SOURCE_DIR}/libraries/opus/.libs/libopus.a)
|
|
@ -0,0 +1,458 @@
|
|||
// Read an INI file into easy-to-access name/value pairs.
|
||||
|
||||
// inih and INIReader are released under the New BSD license (see LICENSE.txt).
|
||||
// Go to the project home page for more info:
|
||||
//
|
||||
// https://github.com/benhoyt/inih
|
||||
/* inih -- simple .INI file parser
|
||||
|
||||
inih is released under the New BSD license (see LICENSE.txt). Go to the project
|
||||
home page for more info:
|
||||
|
||||
https://github.com/benhoyt/inih
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __INI_H__
|
||||
#define __INI_H__
|
||||
|
||||
/* Make this header file easier to include in C++ code */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Typedef for prototype of handler function. */
|
||||
typedef int (*ini_handler)(void* user, const char* section,
|
||||
const char* name, const char* value);
|
||||
|
||||
/* Typedef for prototype of fgets-style reader function. */
|
||||
typedef char* (*ini_reader)(char* str, int num, void* stream);
|
||||
|
||||
/* Parse given INI-style file. May have [section]s, name=value pairs
|
||||
(whitespace stripped), and comments starting with ';' (semicolon). Section
|
||||
is "" if name=value pair parsed before any section heading. name:value
|
||||
pairs are also supported as a concession to Python's configparser.
|
||||
|
||||
For each name=value pair parsed, call handler function with given user
|
||||
pointer as well as section, name, and value (data only valid for duration
|
||||
of handler call). Handler should return nonzero on success, zero on error.
|
||||
|
||||
Returns 0 on success, line number of first error on parse error (doesn't
|
||||
stop on first error), -1 on file open error, or -2 on memory allocation
|
||||
error (only when INI_USE_STACK is zero).
|
||||
*/
|
||||
int ini_parse(const char* filename, ini_handler handler, void* user);
|
||||
|
||||
/* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't
|
||||
close the file when it's finished -- the caller must do that. */
|
||||
int ini_parse_file(FILE* file, ini_handler handler, void* user);
|
||||
|
||||
inline int ini_parse_message(const std::string& message, ini_handler handler, void* user);
|
||||
|
||||
/* Same as ini_parse(), but takes an ini_reader function pointer instead of
|
||||
filename. Used for implementing custom or string-based I/O. */
|
||||
int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
|
||||
void* user);
|
||||
|
||||
/* Nonzero to allow multi-line value parsing, in the style of Python's
|
||||
configparser. If allowed, ini_parse() will call the handler with the same
|
||||
name for each subsequent line parsed. */
|
||||
#ifndef INI_ALLOW_MULTILINE
|
||||
#define INI_ALLOW_MULTILINE 1
|
||||
#endif
|
||||
|
||||
/* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of
|
||||
the file. See http://code.google.com/p/inih/issues/detail?id=21 */
|
||||
#ifndef INI_ALLOW_BOM
|
||||
#define INI_ALLOW_BOM 1
|
||||
#endif
|
||||
|
||||
/* Nonzero to allow inline comments (with valid inline comment characters
|
||||
specified by INI_INLINE_COMMENT_PREFIXES). Set to 0 to turn off and match
|
||||
Python 3.2+ configparser behaviour. */
|
||||
#ifndef INI_ALLOW_INLINE_COMMENTS
|
||||
#define INI_ALLOW_INLINE_COMMENTS 1
|
||||
#endif
|
||||
#ifndef INI_INLINE_COMMENT_PREFIXES
|
||||
#define INI_INLINE_COMMENT_PREFIXES ";"
|
||||
#endif
|
||||
|
||||
/* Nonzero to use stack, zero to use heap (malloc/free). */
|
||||
#ifndef INI_USE_STACK
|
||||
#define INI_USE_STACK 1
|
||||
#endif
|
||||
|
||||
/* Stop parsing on first error (default is to keep parsing). */
|
||||
#ifndef INI_STOP_ON_FIRST_ERROR
|
||||
#define INI_STOP_ON_FIRST_ERROR 0
|
||||
#endif
|
||||
|
||||
/* Maximum line length for any line in INI file. */
|
||||
#ifndef INI_MAX_LINE
|
||||
#define INI_MAX_LINE 200
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* inih -- simple .INI file parser
|
||||
|
||||
inih is released under the New BSD license (see LICENSE.txt). Go to the project
|
||||
home page for more info:
|
||||
|
||||
https://github.com/benhoyt/inih
|
||||
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <sstream>
|
||||
|
||||
#if !INI_USE_STACK
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#define MAX_SECTION 50
|
||||
#define MAX_NAME 50
|
||||
|
||||
/* Strip whitespace chars off end of given string, in place. Return s. */
|
||||
inline static char* rstrip(char* s)
|
||||
{
|
||||
char* p = s + strlen(s);
|
||||
while (p > s && isspace((unsigned char)(*--p)))
|
||||
*p = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
/* Return pointer to first non-whitespace char in given string. */
|
||||
inline static char* lskip(const char* s)
|
||||
{
|
||||
while (*s && isspace((unsigned char)(*s)))
|
||||
s++;
|
||||
return (char*)s;
|
||||
}
|
||||
|
||||
/* Return pointer to first char (of chars) or inline comment in given string,
|
||||
or pointer to null at end of string if neither found. Inline comment must
|
||||
be prefixed by a whitespace character to register as a comment. */
|
||||
inline static char* find_chars_or_comment(const char* s, const char* chars)
|
||||
{
|
||||
#if INI_ALLOW_INLINE_COMMENTS
|
||||
int was_space = 0;
|
||||
while (*s && (!chars || !strchr(chars, *s)) &&
|
||||
!(was_space && strchr(INI_INLINE_COMMENT_PREFIXES, *s))) {
|
||||
was_space = isspace((unsigned char)(*s));
|
||||
s++;
|
||||
}
|
||||
#else
|
||||
while (*s && (!chars || !strchr(chars, *s))) {
|
||||
s++;
|
||||
}
|
||||
#endif
|
||||
return (char*)s;
|
||||
}
|
||||
|
||||
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */
|
||||
inline static char* strncpy0(char* dest, const char* src, size_t size)
|
||||
{
|
||||
strncpy(dest, src, size);
|
||||
dest[size - 1] = '\0';
|
||||
return dest;
|
||||
}
|
||||
|
||||
/* See documentation in header file. */
|
||||
inline int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
|
||||
void* user)
|
||||
{
|
||||
/* Uses a fair bit of stack (use heap instead if you need to) */
|
||||
#if INI_USE_STACK
|
||||
char line[INI_MAX_LINE];
|
||||
#else
|
||||
char* line;
|
||||
#endif
|
||||
char section[MAX_SECTION] = "";
|
||||
char prev_name[MAX_NAME] = "";
|
||||
|
||||
char* start;
|
||||
char* end;
|
||||
char* name;
|
||||
char* value;
|
||||
int lineno = 0;
|
||||
int error = 0;
|
||||
|
||||
#if !INI_USE_STACK
|
||||
line = (char*)malloc(INI_MAX_LINE);
|
||||
if (!line) {
|
||||
return -2;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Scan through stream line by line */
|
||||
while (reader(line, INI_MAX_LINE, stream) != NULL) {
|
||||
lineno++;
|
||||
|
||||
start = line;
|
||||
#if INI_ALLOW_BOM
|
||||
if (lineno == 1 && (unsigned char)start[0] == 0xEF &&
|
||||
(unsigned char)start[1] == 0xBB &&
|
||||
(unsigned char)start[2] == 0xBF) {
|
||||
start += 3;
|
||||
}
|
||||
#endif
|
||||
start = lskip(rstrip(start));
|
||||
|
||||
if (*start == ';' || *start == '#') {
|
||||
/* Per Python configparser, allow both ; and # comments at the
|
||||
start of a line */
|
||||
}
|
||||
#if INI_ALLOW_MULTILINE
|
||||
else if (*prev_name && *start && start > line) {
|
||||
|
||||
#if INI_ALLOW_INLINE_COMMENTS
|
||||
end = find_chars_or_comment(start, NULL);
|
||||
if (*end)
|
||||
*end = '\0';
|
||||
rstrip(start);
|
||||
#endif
|
||||
|
||||
/* Non-blank line with leading whitespace, treat as continuation
|
||||
of previous name's value (as per Python configparser). */
|
||||
if (!handler(user, section, prev_name, start) && !error)
|
||||
error = lineno;
|
||||
}
|
||||
#endif
|
||||
else if (*start == '[') {
|
||||
/* A "[section]" line */
|
||||
end = find_chars_or_comment(start + 1, "]");
|
||||
if (*end == ']') {
|
||||
*end = '\0';
|
||||
strncpy0(section, start + 1, sizeof(section));
|
||||
*prev_name = '\0';
|
||||
}
|
||||
else if (!error) {
|
||||
/* No ']' found on section line */
|
||||
error = lineno;
|
||||
}
|
||||
}
|
||||
else if (*start) {
|
||||
/* Not a comment, must be a name[=:]value pair */
|
||||
end = find_chars_or_comment(start, "=:");
|
||||
if (*end == '=' || *end == ':') {
|
||||
*end = '\0';
|
||||
name = rstrip(start);
|
||||
value = lskip(end + 1);
|
||||
#if INI_ALLOW_INLINE_COMMENTS
|
||||
end = find_chars_or_comment(value, NULL);
|
||||
if (*end)
|
||||
*end = '\0';
|
||||
#endif
|
||||
rstrip(value);
|
||||
|
||||
/* Valid name[=:]value pair found, call handler */
|
||||
strncpy0(prev_name, name, sizeof(prev_name));
|
||||
if (!handler(user, section, name, value) && !error)
|
||||
error = lineno;
|
||||
}
|
||||
else if (!error) {
|
||||
/* No '=' or ':' found on name[=:]value line */
|
||||
error = lineno;
|
||||
}
|
||||
}
|
||||
|
||||
#if INI_STOP_ON_FIRST_ERROR
|
||||
if (error)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !INI_USE_STACK
|
||||
free(line);
|
||||
#endif
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/* See documentation in header file. */
|
||||
inline int ini_parse_file(FILE* file, ini_handler handler, void* user)
|
||||
{
|
||||
return ini_parse_stream((ini_reader)fgets, file, handler, user);
|
||||
}
|
||||
|
||||
/* See documentation in header file. */
|
||||
inline int ini_parse_message(const std::string& message, ini_handler handler, void* user)
|
||||
{
|
||||
std::istringstream stream(message);
|
||||
return ini_parse_stream((ini_reader) [](char* str, int num, void* ptrStream) {
|
||||
auto stream = (std::istringstream*) ptrStream;
|
||||
stream->getline(str, num);
|
||||
return !!*stream ? str : nullptr;
|
||||
}, &stream, handler, user);
|
||||
}
|
||||
|
||||
/* See documentation in header file. */
|
||||
inline int ini_parse(const char* filename, ini_handler handler, void* user)
|
||||
{
|
||||
FILE* file;
|
||||
int error;
|
||||
|
||||
file = fopen(filename, "r");
|
||||
if (!file)
|
||||
return -1;
|
||||
error = ini_parse_file(file, handler, user);
|
||||
fclose(file);
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif /* __INI_H__ */
|
||||
|
||||
|
||||
#ifndef __INIREADER_H__
|
||||
#define __INIREADER_H__
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
// Read an INI file into easy-to-access name/value pairs. (Note that I've gone
|
||||
// for simplicity here rather than speed, but it should be pretty decent.)
|
||||
class INIReader
|
||||
{
|
||||
public:
|
||||
// Empty Constructor
|
||||
INIReader() {};
|
||||
|
||||
// Construct INIReader and parse given filename. See ini.h for more info
|
||||
// about the parsing.
|
||||
INIReader(std::string filename, bool raw = false);
|
||||
|
||||
// Return the result of ini_parse(), i.e., 0 on success, line number of
|
||||
// first error on parse error, or -1 on file open error.
|
||||
int ParseError() const;
|
||||
|
||||
// Return the list of sections found in ini file
|
||||
std::set<std::string> Sections();
|
||||
|
||||
// Get a string value from INI file, returning default_value if not found.
|
||||
std::string Get(std::string section, std::string name,
|
||||
std::string default_value);
|
||||
|
||||
// Get an integer (long) value from INI file, returning default_value if
|
||||
// not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2").
|
||||
long GetInteger(std::string section, std::string name, long default_value);
|
||||
|
||||
// Get a real (floating point double) value from INI file, returning
|
||||
// default_value if not found or not a valid floating point value
|
||||
// according to strtod().
|
||||
double GetReal(std::string section, std::string name, double default_value);
|
||||
|
||||
// Get a boolean value from INI file, returning default_value if not found or if
|
||||
// not a valid true/false value. Valid true values are "true", "yes", "on", "1",
|
||||
// and valid false values are "false", "no", "off", "0" (not case sensitive).
|
||||
bool GetBoolean(std::string section, std::string name, bool default_value);
|
||||
|
||||
private:
|
||||
int _error;
|
||||
std::map<std::string, std::string> _values;
|
||||
std::set<std::string> _sections;
|
||||
static std::string MakeKey(std::string section, std::string name);
|
||||
static int ValueHandler(void* user, const char* section, const char* name,
|
||||
const char* value);
|
||||
};
|
||||
|
||||
#endif // __INIREADER_H__
|
||||
|
||||
|
||||
#ifndef __INIREADER__
|
||||
#define __INIREADER__
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cstdlib>
|
||||
|
||||
using std::string;
|
||||
|
||||
inline INIReader::INIReader(string data, bool raw)
|
||||
{
|
||||
if(raw)
|
||||
_error = ini_parse_message(data, ValueHandler, this);
|
||||
else
|
||||
_error = ini_parse(data.c_str(), ValueHandler, this);
|
||||
}
|
||||
|
||||
inline int INIReader::ParseError() const
|
||||
{
|
||||
return _error;
|
||||
}
|
||||
|
||||
inline std::set<string> INIReader::Sections()
|
||||
{
|
||||
return _sections;
|
||||
}
|
||||
|
||||
inline string INIReader::Get(string section, string name, string default_value)
|
||||
{
|
||||
string key = MakeKey(section, name);
|
||||
return _values.count(key) ? _values[key] : default_value;
|
||||
}
|
||||
|
||||
inline long INIReader::GetInteger(string section, string name, long default_value)
|
||||
{
|
||||
string valstr = Get(section, name, "");
|
||||
const char* value = valstr.c_str();
|
||||
char* end;
|
||||
// This parses "1234" (decimal) and also "0x4D2" (hex)
|
||||
long n = strtol(value, &end, 0);
|
||||
return end > value ? n : default_value;
|
||||
}
|
||||
|
||||
inline double INIReader::GetReal(string section, string name, double default_value)
|
||||
{
|
||||
string valstr = Get(section, name, "");
|
||||
const char* value = valstr.c_str();
|
||||
char* end;
|
||||
double n = strtod(value, &end);
|
||||
return end > value ? n : default_value;
|
||||
}
|
||||
|
||||
inline bool INIReader::GetBoolean(string section, string name, bool default_value)
|
||||
{
|
||||
string valstr = Get(section, name, "");
|
||||
// Convert to lower case to make string comparisons case-insensitive
|
||||
std::transform(valstr.begin(), valstr.end(), valstr.begin(), ::tolower);
|
||||
if (valstr == "true" || valstr == "yes" || valstr == "on" || valstr == "1")
|
||||
return true;
|
||||
else if (valstr == "false" || valstr == "no" || valstr == "off" || valstr == "0")
|
||||
return false;
|
||||
else
|
||||
return default_value;
|
||||
}
|
||||
|
||||
inline string INIReader::MakeKey(string section, string name)
|
||||
{
|
||||
string key = section + "=" + name;
|
||||
// Convert to lower case to make section/name lookups case-insensitive
|
||||
std::transform(key.begin(), key.end(), key.begin(), ::tolower);
|
||||
return key;
|
||||
}
|
||||
|
||||
inline int INIReader::ValueHandler(void* user, const char* section, const char* name,
|
||||
const char* value)
|
||||
{
|
||||
INIReader* reader = (INIReader*)user;
|
||||
string key = MakeKey(section, name);
|
||||
if (reader->_values[key].size() > 0)
|
||||
reader->_values[key] += "\n";
|
||||
reader->_values[key] += value;
|
||||
reader->_sections.insert(section);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif // __INIREADER__
|
|
@ -0,0 +1,283 @@
|
|||
#include "Identity.h"
|
||||
#include <iostream>
|
||||
#include "base64.h"
|
||||
|
||||
#define SHA_DIGEST_LENGTH 20
|
||||
#define ECC_TYPE_INDEX 5
|
||||
|
||||
static const char *TSKEY =
|
||||
"b9dfaa7bee6ac57ac7b65f1094a1c155"
|
||||
"e747327bc2fe5d51c512023fe54a2802"
|
||||
"01004e90ad1daaae1075d53b7d571c30"
|
||||
"e063b5a62a4a017bb394833aa0983e6e";
|
||||
|
||||
using namespace std;
|
||||
|
||||
inline int SHA1(const char* input, size_t length, char* result) {
|
||||
hash_state ctx = {};
|
||||
if (sha1_init(&ctx) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
if (sha1_process(&ctx, (uint8_t*) input, length) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
if (sha1_done(&ctx, (uint8_t*) result) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decriptIdentity(char *data, uint32_t length) {
|
||||
int dataSize = std::min((uint32_t) 100, length);
|
||||
for (int i = 0; i < dataSize; i++) {
|
||||
data[i] ^= TSKEY[i];
|
||||
}
|
||||
|
||||
char hash[SHA_DIGEST_LENGTH];
|
||||
//if(SHA1(data + 20, strlen(data + 20), hash) < 0) return -1;
|
||||
|
||||
hash_state ctx = {};
|
||||
if (sha1_init(&ctx) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
if (sha1_process(&ctx, (uint8_t*)data + 20, strlen(data + 20)) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
if (sha1_done(&ctx, (uint8_t*)hash) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
data[i] ^= hash[i];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int encriptIdentity(char *data, uint32_t length) {
|
||||
char hash[SHA_DIGEST_LENGTH];
|
||||
//if(SHA1(data, length, hash) < 0) return -1;
|
||||
|
||||
hash_state ctx;
|
||||
if (sha1_init(&ctx) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
if (sha1_process(&ctx, (uint8_t*)data + 20, strlen(data + 20)) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
if (sha1_done(&ctx, (uint8_t*)hash) != CRYPT_OK)
|
||||
{ return -1; }
|
||||
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
data[i] ^= hash[i];
|
||||
}
|
||||
|
||||
int dataSize = std::min((uint32_t) 100, length);
|
||||
for (int i = 0; i < dataSize; i++) {
|
||||
data[i] ^= TSKEY[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
namespace ts {
|
||||
Identity* Identity::createNew() {
|
||||
auto result = new Identity();
|
||||
|
||||
prng_state rndState = {};
|
||||
memset(&rndState, 0, sizeof(prng_state));
|
||||
int err;
|
||||
|
||||
result->keyPair = new ecc_key;
|
||||
|
||||
//cout << " -> " << find_prng("sprng") << endl;
|
||||
if((err = ecc_make_key_ex(&rndState, find_prng("sprng"), result->keyPair, <c_ecc_sets[ECC_TYPE_INDEX])) != CRYPT_OK){
|
||||
printf("Cant create a new identity (Keygen)\n");
|
||||
printf("Message: %s\n", error_to_string(err));
|
||||
delete result;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Identity* Identity::parse(const std::string& data, std::string& error) {
|
||||
int vindex = data.find('V');
|
||||
if(vindex <= 0) {
|
||||
error = "Invalid structure";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto slevel = data.substr(0, vindex);
|
||||
if(slevel.find_first_not_of("0123456789") != std::string::npos) {
|
||||
error = "Invalid offset (" + slevel + ")";
|
||||
return nullptr;
|
||||
}
|
||||
mp_int keyOffset{};
|
||||
mp_init(&keyOffset);
|
||||
mp_read_radix(&keyOffset, slevel.data(), 10);
|
||||
|
||||
auto keyData = data.substr(vindex + 1);
|
||||
keyData = base64::decode(keyData);
|
||||
if(encriptIdentity(&keyData[0], keyData.length()) < 0) {
|
||||
error = "Could not decrypt key";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto identity = new Identity(base64::decode(keyData), keyOffset, keyOffset);
|
||||
if(!identity->keyPair) {
|
||||
error = "Could not load key";
|
||||
delete identity;
|
||||
return nullptr;
|
||||
}
|
||||
printf("X: %s | %s\n", slevel.c_str(), identity->lastValidKeyOffsetString().c_str());
|
||||
return identity;
|
||||
}
|
||||
|
||||
Identity::Identity(const std::string& asnStruct, mp_int keyOffset, mp_int lastCheckedOffset) {
|
||||
this->keyOffset = keyOffset;
|
||||
this->lastCheckedOffset = lastCheckedOffset;
|
||||
importKey(asnStruct);
|
||||
|
||||
mp_init_copy(&this->keyOffset, &keyOffset);
|
||||
mp_init_copy(&this->lastCheckedOffset, &lastCheckedOffset);
|
||||
}
|
||||
|
||||
Identity::Identity() {
|
||||
mp_init_multi(&this->keyOffset, &this->lastCheckedOffset, nullptr);
|
||||
this->keyPair = nullptr;
|
||||
}
|
||||
|
||||
Identity::~Identity() {
|
||||
delete this->keyPair;
|
||||
this->keyPair = nullptr;
|
||||
|
||||
mp_clear_multi(&this->keyOffset, &this->lastCheckedOffset, nullptr);
|
||||
}
|
||||
|
||||
void Identity::importKey(std::string asnStruct) {
|
||||
this->keyPair = new ecc_key;
|
||||
int err;
|
||||
if((err = ecc_import_ex((const unsigned char *) asnStruct.data(), asnStruct.length(), this->keyPair, <c_ecc_sets[ECC_TYPE_INDEX])) != CRYPT_OK){
|
||||
delete this->keyPair;
|
||||
this->keyPair = nullptr;
|
||||
|
||||
printf("Cant import identity from asn structure\n");
|
||||
printf("Message: %s\n", error_to_string(err));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Identity::exportIdentity() {
|
||||
std::string data = privateKey();
|
||||
decriptIdentity((char *) data.data(), data.length());
|
||||
return this->lastValidKeyOffsetString() + "V" + base64_encode(data);
|
||||
}
|
||||
|
||||
std::string Identity::uid() {
|
||||
char buffer[SHA_DIGEST_LENGTH];
|
||||
auto key = this->publicKey();
|
||||
SHA1(key.data(), key.length(), buffer);
|
||||
return base64::encode(buffer, SHA_DIGEST_LENGTH);
|
||||
}
|
||||
|
||||
inline string hex(string input, char beg, char end){
|
||||
assert(end - beg == 16);
|
||||
|
||||
int len = input.length() * 2;
|
||||
char output[len];
|
||||
int idx = 0;
|
||||
for(int index = 0; index < input.length(); index++){
|
||||
char elm = input[index];
|
||||
output[idx++] = static_cast<char>(beg + ((elm >> 4) & 0x0F));
|
||||
output[idx++] = static_cast<char>(beg + ((elm & 0x0F) >> 0));
|
||||
}
|
||||
|
||||
return string(output, len);
|
||||
}
|
||||
|
||||
std::string Identity::avatarId() {
|
||||
return hex(base64::decode(this->uid()), 'a', 'q');
|
||||
}
|
||||
|
||||
std::string Identity::publicKey() {
|
||||
assert(this->keyPair);
|
||||
|
||||
ulong32 bufferLength = 1028;
|
||||
char buffer[bufferLength];
|
||||
ecc_export((unsigned char *) buffer, &bufferLength, PK_PUBLIC, this->keyPair);
|
||||
|
||||
return base64_encode(std::string(buffer, bufferLength));
|
||||
}
|
||||
|
||||
std::string Identity::privateKey() {
|
||||
assert(this->keyPair);
|
||||
|
||||
ulong32 bufferLength = 1028;
|
||||
char buffer[bufferLength];
|
||||
ecc_export((unsigned char *) buffer, &bufferLength, PK_PRIVATE, this->keyPair);
|
||||
|
||||
return base64_encode(std::string(buffer, bufferLength));
|
||||
}
|
||||
|
||||
ecc_key& Identity::getPrivateKey() {
|
||||
return *keyPair;
|
||||
}
|
||||
|
||||
#define MaxUlongString 20
|
||||
|
||||
bool Identity::improveSecurityLevel(int target) {
|
||||
auto publicKey = this->publicKey();
|
||||
char hashBuffer[publicKey.length() + MaxUlongString];
|
||||
memcpy(hashBuffer, publicKey.data(), publicKey.length());
|
||||
|
||||
if(mp_cmp(&this->lastCheckedOffset, &this->keyOffset) < 0)
|
||||
mp_copy(&this->keyOffset, &this->lastCheckedOffset);
|
||||
int best = getSecurityLevel(hashBuffer, publicKey.length(), this->lastCheckedOffset);
|
||||
while(true){
|
||||
if(best >= target) return true;
|
||||
|
||||
int currentLevel = getSecurityLevel(hashBuffer, publicKey.length(), this->lastCheckedOffset);
|
||||
if(currentLevel >= best){
|
||||
this->keyOffset = this->lastCheckedOffset;
|
||||
best = currentLevel;
|
||||
}
|
||||
mp_add_d(&this->lastCheckedOffset, 1, &this->lastCheckedOffset);
|
||||
}
|
||||
}
|
||||
|
||||
int Identity::getSecurityLevel() {
|
||||
auto length = publicKey().length();
|
||||
char hashBuffer[length + MaxUlongString];
|
||||
|
||||
auto publicKey = this->publicKey();
|
||||
memcpy(hashBuffer, publicKey.data(), publicKey.length());
|
||||
|
||||
return getSecurityLevel(hashBuffer, publicKey.length(), this->keyOffset);
|
||||
}
|
||||
|
||||
int Identity::getSecurityLevel(char *hashBuffer, size_t keyLength, mp_int offset) {
|
||||
char numBuffer[MaxUlongString];
|
||||
mp_todecimal(&offset, numBuffer);
|
||||
/*
|
||||
int numLen = 0;
|
||||
do {
|
||||
numBuffer[numLen] = '0' + (offset % 10);
|
||||
offset /= 10;
|
||||
numLen++;
|
||||
} while(offset > 0);
|
||||
for(int i = 0; i < numLen; i++)
|
||||
hashBuffer[keyLength + i] = numBuffer[numLen - (i + 1)];
|
||||
*/
|
||||
auto numLen = strlen(numBuffer);
|
||||
memcpy(&hashBuffer[keyLength], numBuffer, numLen);
|
||||
|
||||
char shaBuffer[SHA_DIGEST_LENGTH];
|
||||
SHA1(hashBuffer, keyLength + numLen, shaBuffer);
|
||||
|
||||
//Leading zero bits
|
||||
int zeroBits = 0;
|
||||
int i;
|
||||
for(i = 0; i < SHA_DIGEST_LENGTH; i++)
|
||||
if(shaBuffer[i] == 0) zeroBits += 8;
|
||||
else break;
|
||||
if(i < SHA_DIGEST_LENGTH)
|
||||
for(int bit = 0; bit < 8; bit++)
|
||||
if((shaBuffer[i] & (1 << bit)) == 0) zeroBits++;
|
||||
else break;
|
||||
return zeroBits;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
#pragma once
|
||||
|
||||
#include <tomcrypt.h>
|
||||
#include <string>
|
||||
#include <tommath.h>
|
||||
|
||||
namespace ts {
|
||||
class Identity {
|
||||
inline std::string toString(const mp_int& num) {
|
||||
char buffer[1024];
|
||||
mp_todecimal(&num, buffer);
|
||||
return std::string(buffer);
|
||||
}
|
||||
public:
|
||||
static Identity* createNew();
|
||||
static Identity* parse(const std::string&, std::string&);
|
||||
|
||||
Identity(const std::string& asnStruct,mp_int keyOffset,mp_int lastCheckedOffset);
|
||||
~Identity();
|
||||
|
||||
bool valid(){ return keyPair != nullptr; }
|
||||
|
||||
std::string uid();
|
||||
std::string avatarId();
|
||||
|
||||
std::string publicKey();
|
||||
std::string privateKey();
|
||||
std::string exportIdentity();
|
||||
|
||||
ecc_key* getKeyPair(){
|
||||
return keyPair;
|
||||
}
|
||||
|
||||
ecc_key& getPrivateKey();
|
||||
|
||||
bool improveSecurityLevel(int target);
|
||||
int getSecurityLevel();
|
||||
|
||||
mp_int lastValidKeyOffset(){ return keyOffset; }
|
||||
mp_int lastTestedKeyOffset(){ return lastCheckedOffset; }
|
||||
|
||||
std::string lastValidKeyOffsetString(){
|
||||
return toString(this->lastValidKeyOffset());
|
||||
}
|
||||
|
||||
std::string lastTestedKeyOffsetString(){
|
||||
return toString(this->lastTestedKeyOffset());
|
||||
}
|
||||
private:
|
||||
Identity();
|
||||
|
||||
int getSecurityLevel(char* hasBuffer, size_t keyLength, mp_int offset);
|
||||
void importKey(std::string asn1);
|
||||
|
||||
ecc_key* keyPair = nullptr;
|
||||
mp_int keyOffset;
|
||||
mp_int lastCheckedOffset;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
#include <cstdio>
|
||||
#include <emscripten.h>
|
||||
#include <emscripten/bind.h>
|
||||
#include <tomcrypt.h>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include "Identity.h"
|
||||
#include "base64.h"
|
||||
#define INI_MAX_LINE 1024
|
||||
#include "INIReader.h"
|
||||
|
||||
using namespace emscripten;
|
||||
using namespace std;
|
||||
extern "C" {
|
||||
std::string errorMessage = "";
|
||||
|
||||
inline const char* cstr(const std::string& message) {
|
||||
auto buffer = (char*) malloc(message.length() + 1);
|
||||
cout << "Allocating at " << (void*) buffer << endl;
|
||||
buffer[message.length()] = '\0';
|
||||
memcpy(buffer, message.data(), message.length());
|
||||
return buffer;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
const char* last_error_message() {
|
||||
return cstr(errorMessage);
|
||||
};
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
void destroy_string(const char* str) {
|
||||
cout << "Deallocating at " << (void*) str << endl;
|
||||
if(str) free((void *) str);
|
||||
};
|
||||
|
||||
inline void clear_error() { errorMessage = ""; }
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
int tomcrypt_initialize() {
|
||||
init_LTM();
|
||||
if(register_prng(&sprng_desc) == -1) {
|
||||
printf("could not setup prng\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (register_cipher(&rijndael_desc) == -1) {
|
||||
printf("could not setup rijndael\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
cout << "Initialized!" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
void* parse_identity(const char* input) {
|
||||
cout << "Got messsage: " << input << endl;
|
||||
clear_error();
|
||||
return ts::Identity::parse(input, errorMessage);
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
void* parse_identity_file(const char* input) {
|
||||
clear_error();
|
||||
INIReader reader(input, true);
|
||||
if(reader.ParseError() != 0) {
|
||||
errorMessage = "Could not parse file " + to_string(reader.ParseError());
|
||||
return nullptr;
|
||||
}
|
||||
auto identity = reader.Get("Identity", "identity", "");
|
||||
if(!identity.empty() && identity[0] == '"')
|
||||
identity = identity.substr(1);
|
||||
if(!identity.empty() && identity.back() == '"')
|
||||
identity = identity.substr(0, identity.length() - 1);
|
||||
if(identity.empty()) {
|
||||
errorMessage = "Mussing identity value at Identity::identity";
|
||||
return nullptr;
|
||||
}
|
||||
return ts::Identity::parse(identity, errorMessage);
|
||||
}
|
||||
|
||||
#define IDENTITIEFY(_ret) \
|
||||
auto identity = dynamic_cast<ts::Identity*>((ts::Identity*) ptrIdentity); \
|
||||
if(!identity) { \
|
||||
errorMessage = "Invalid identity pointer!"; \
|
||||
return _ret; \
|
||||
}
|
||||
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
void delete_identity(void* ptrIdentity) {
|
||||
IDENTITIEFY(;);
|
||||
delete identity;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
const char* identity_security_level(void* ptrIdentity) {
|
||||
IDENTITIEFY("");
|
||||
return cstr(std::to_string(identity->getSecurityLevel()));
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
const char* identity_export(void* ptrIdentity) {
|
||||
IDENTITIEFY("");
|
||||
return cstr(identity->exportIdentity());
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
const char* identity_key_public(void* ptrIdentity) {
|
||||
IDENTITIEFY("");
|
||||
return cstr(identity->publicKey());
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
const char* identity_uid(void* ptrIdentity) {
|
||||
IDENTITIEFY("");
|
||||
return cstr(identity->uid());
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
const char* identity_sign(void* ptrIdentity, const char* message, int length) {
|
||||
IDENTITIEFY("");
|
||||
|
||||
ulong32 bufferLength = 128;
|
||||
char signBuffer[bufferLength];
|
||||
|
||||
prng_state rndState = {};
|
||||
memset(&rndState, 0, sizeof(prng_state));
|
||||
|
||||
auto state = ecc_sign_hash((const unsigned char*) message, length, reinterpret_cast<unsigned char *>(signBuffer), &bufferLength, &rndState, find_prng("sprng"), identity->getKeyPair());
|
||||
if(state != CRYPT_OK) {
|
||||
errorMessage = "Could not sign message (" + std::string(error_to_string(state)) + "|" + std::to_string(state) + ")";
|
||||
return "";
|
||||
}
|
||||
|
||||
return cstr(base64::encode(signBuffer, bufferLength));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <tomcrypt.h>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
namespace base64 {
|
||||
/**
|
||||
* Encodes a given string in Base64
|
||||
* @param input The input string to Base64-encode
|
||||
* @param inputSize The size of the input to decode
|
||||
* @return A Base64-encoded version of the encoded string
|
||||
*/
|
||||
inline std::string encode(const char* input, const unsigned long inputSize) {
|
||||
auto outlen = static_cast<unsigned long>(inputSize + (inputSize / 3.0) + 16);
|
||||
auto outbuf = new unsigned char[outlen]; //Reserve output memory
|
||||
if(base64_encode((unsigned char*) input, inputSize, outbuf, &outlen) != CRYPT_OK){
|
||||
std::cerr << "Invalid input '" << input << "'" << std::endl;
|
||||
return "";
|
||||
}
|
||||
std::string ret((char*) outbuf, outlen);
|
||||
delete[] outbuf;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes a given string in Base64
|
||||
* @param input The input string to Base64-encode
|
||||
* @return A Base64-encoded version of the encoded string
|
||||
*/
|
||||
inline std::string encode(const std::string& input) { return encode(input.c_str(), input.size()); }
|
||||
|
||||
|
||||
/**
|
||||
* Decodes a Base64-encoded string.
|
||||
* @param input The input string to decode
|
||||
* @return A string (binary) that represents the Base64-decoded data of the input
|
||||
*/
|
||||
inline std::string decode(const char* input, ulong32 size) {
|
||||
auto out = new unsigned char[size];
|
||||
if(base64_strict_decode((unsigned char*) input, size, out, &size) != CRYPT_OK){
|
||||
std::cerr << "Invalid base 64 string '" << input << "'" << std::endl;
|
||||
return "";
|
||||
}
|
||||
std::string ret((char*) out, size);
|
||||
delete[] out;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes a Base64-encoded string.
|
||||
* @param input The input string to decode
|
||||
* @return A string (binary) that represents the Base64-decoded data of the input
|
||||
*/
|
||||
inline std::string decode(const std::string& input) { return decode(input.c_str(), input.size()); }
|
||||
}
|
||||
inline std::string base64_encode(const char* input, const unsigned long inputSize) { return base64::encode(input, inputSize); }
|
||||
inline std::string base64_encode(const std::string& input) { return base64::encode(input.c_str(), input.size()); }
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 655cc54c564b84ef2827f0b2152ce3811046201e
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0f7fd3c606c204cf13b39ca35722782d3d05e319
|
|
@ -0,0 +1 @@
|
|||
Subproject commit fe6cc64884b2b408b607389f46266d44fd942a79
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
OPUS_FN="'_free','_malloc','_opus_strerror','_opus_get_version_string','_opus_encoder_get_size','_opus_encoder_init','_opus_encode','_opus_encode_float','_opus_encoder_ctl','_opus_decoder_get_size','_opus_decoder_init','_opus_decode','_opus_decode_float','_opus_decoder_ctl','_opus_packet_get_nb_samples'"
|
||||
cd libs/opus/
|
||||
|
||||
git checkout v1.1.2
|
||||
./autogen.sh
|
||||
emconfigure ./configure --disable-extra-programs --disable-doc --disable-rtcd
|
||||
emmake make
|
||||
cd ../../
|
||||
emcc -o generated/libopus.js -O3 --memory-init-file 0 --closure 1 -s NO_FILESYSTEM=1 -s MODULARIZE=1 -s EXPORTED_FUNCTIONS="[$OPUS_FN]" libs/opus/.libs/libopus.a
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
#include <opus.h>
|
||||
#include <emscripten.h>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
extern "C" {
|
||||
struct OpusHandle {
|
||||
OpusEncoder* encoder = nullptr;
|
||||
OpusDecoder* decoder = nullptr;
|
||||
|
||||
size_t channelCount = 1;
|
||||
int opusType = OPUS_APPLICATION_AUDIO;
|
||||
};
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
OpusHandle* codec_opus_createNativeHandle(size_t channelCount, int type) {
|
||||
printf("Inizalisize opus. (Channel count: %d Sample rate: %d Type: %d)!\n", channelCount, 48000, type);
|
||||
auto codec = new OpusHandle{};
|
||||
int error = 0;
|
||||
codec->decoder = opus_decoder_create(48000, channelCount, &error);
|
||||
codec->encoder = opus_encoder_create(48000, channelCount, type, &error);
|
||||
codec->opusType = type;
|
||||
return codec;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
void codec_opus_deleteNativeHandle(OpusHandle* codec) {
|
||||
if(!codec) return;
|
||||
|
||||
if(codec->decoder) opus_decoder_destroy(codec->decoder);
|
||||
codec->decoder = nullptr;
|
||||
|
||||
if(codec->encoder) opus_encoder_destroy(codec->encoder);
|
||||
codec->encoder = nullptr;
|
||||
|
||||
delete codec;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
int codec_opus_encode(OpusHandle* handle, uint8_t* buffer, size_t length, size_t maxLength) {
|
||||
auto result = opus_encode_float(handle->encoder, (float*) buffer, length / handle->channelCount, buffer, maxLength);
|
||||
if(result < 0) return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
int codec_opus_decode(OpusHandle* handle, uint8_t* buffer, size_t length, size_t maxLength) {
|
||||
auto result = opus_decode_float(handle->decoder, buffer, length, (float*) buffer, maxLength / sizeof(float) / handle->channelCount, false);
|
||||
if(result < 0) return result; //Failed
|
||||
return result;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
int codec_opus_changeApplication(OpusHandle* handle, int type) {
|
||||
handle->opusType = type;
|
||||
if(type != OPUS_APPLICATION_VOIP && type != OPUS_APPLICATION_AUDIO && type != OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
||||
return 1;
|
||||
return opus_encoder_ctl(handle->encoder, OPUS_SET_APPLICATION(type));
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
int codec_opus_reset(OpusHandle* handle) {
|
||||
if(handle->encoder) opus_encoder_destroy(handle->encoder);
|
||||
if(handle->decoder) opus_decoder_destroy(handle->decoder);
|
||||
|
||||
int error = 0;
|
||||
handle->decoder = opus_decoder_create(48000, handle->channelCount, &error);
|
||||
handle->encoder = opus_encoder_create(48000, handle->channelCount, handle->opusType, &error);
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate));
|
||||
opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity));
|
||||
opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type));
|
||||
*/
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="100%"
|
||||
height="100%"
|
||||
viewBox="0 0 128 128"
|
||||
version="1.1"
|
||||
xml:space="preserve"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"
|
||||
id="svg13635"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="loading_image.svg"><metadata
|
||||
id="metadata13682"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs13680" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1017"
|
||||
id="namedview13678"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.84375"
|
||||
inkscape:cx="64"
|
||||
inkscape:cy="64"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg13635" /><g
|
||||
transform="matrix(1,0,0,1,-2688,-480)"
|
||||
id="g13637"><g
|
||||
id="loading_image"
|
||||
transform="matrix(1,0,0,1.37634,2688,294.194)"><rect
|
||||
x="0"
|
||||
y="135"
|
||||
width="128"
|
||||
height="93"
|
||||
style="fill:none;"
|
||||
id="rect13640" /><g
|
||||
transform="matrix(1,0,0,0.726562,0,134.273)"
|
||||
id="g13642"><path
|
||||
d="M9.041,88.646C9.041,84.78 12.175,81.646 16.041,81.646L112.041,81.646C115.907,81.646 119.041,84.78 119.041,88.646L119.041,97.646C119.041,101.512 115.907,104.646 112.041,104.646L16.041,104.646C12.175,104.646 9.041,101.512 9.041,97.646L9.041,88.646L9.041,88.646Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13644" /></g><g
|
||||
transform="matrix(1,0,0,0.726562,0,134.273)"
|
||||
id="g13646"><path
|
||||
d="M9.041,88.646C9.041,84.78 12.175,81.646 16.041,81.646L78.041,81.646C81.907,81.646 85.041,84.78 85.041,88.646L85.041,97.646C85.041,101.512 81.907,104.646 78.041,104.646L16.041,104.646C12.175,104.646 9.041,101.512 9.041,97.646L9.041,88.646L9.041,88.646Z"
|
||||
style="fill:#7289da;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13648" /></g><g
|
||||
transform="matrix(1,0,0,0.726562,0,134.273)"
|
||||
id="g13650"><path
|
||||
d="M8.95,25.658L12.516,25.658L12.516,40.274L19.369,40.274L19.369,43.308L8.95,43.308L8.95,25.658Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13652" /><path
|
||||
d="M29.13,25.354C30.429,25.354 31.6,25.565 32.645,25.986C33.69,26.408 34.579,27.011 35.313,27.795C36.046,28.578 36.611,29.527 37.008,30.639C37.403,31.752 37.602,33.009 37.602,34.407C37.602,35.824 37.395,37.096 36.982,38.225C36.568,39.355 35.987,40.32 35.237,41.121C34.487,41.923 33.576,42.537 32.506,42.967C31.436,43.397 30.243,43.612 28.928,43.612C27.63,43.612 26.449,43.401 25.387,42.98C24.325,42.558 23.423,41.951 22.681,41.159C21.939,40.367 21.366,39.41 20.962,38.289C20.557,37.167 20.355,35.908 20.355,34.509C20.355,31.575 21.123,29.316 22.657,27.731C24.19,26.147 26.349,25.354 29.13,25.354ZM28.915,28.111C28.205,28.111 27.559,28.262 26.976,28.566C26.393,28.87 25.89,29.299 25.467,29.856C25.044,30.412 24.719,31.087 24.49,31.879C24.262,32.671 24.149,33.548 24.149,34.509C24.149,35.469 24.262,36.342 24.49,37.125C24.719,37.909 25.049,38.575 25.479,39.124C25.91,39.671 26.421,40.097 27.013,40.401C27.604,40.705 28.272,40.856 29.016,40.856C29.725,40.856 30.372,40.701 30.956,40.388C31.538,40.076 32.041,39.642 32.464,39.086C32.886,38.529 33.216,37.859 33.453,37.075C33.69,36.291 33.808,35.428 33.808,34.483C33.808,33.505 33.694,32.621 33.465,31.827C33.237,31.035 32.907,30.365 32.476,29.817C32.045,29.269 31.53,28.848 30.93,28.553C30.331,28.258 29.659,28.111 28.915,28.111Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13654" /><path
|
||||
d="M56.77,43.309L52.901,43.309L51.359,39.238L44,39.238L42.458,43.309L38.79,43.309L45.719,25.659L49.74,25.659L56.77,43.309ZM48.93,32.435C48.829,32.165 48.719,31.85 48.602,31.487C48.483,31.125 48.37,30.754 48.26,30.374C48.15,29.996 48.045,29.638 47.944,29.3C47.843,28.963 47.767,28.676 47.716,28.44L47.666,28.44C47.598,28.676 47.514,28.962 47.413,29.3C47.312,29.638 47.198,29.996 47.071,30.374C46.945,30.754 46.822,31.125 46.705,31.487C46.587,31.849 46.477,32.165 46.376,32.435L44.91,36.557L50.397,36.557L48.93,32.435Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13656" /><path
|
||||
d="M63.976,25.658C65.459,25.658 66.837,25.814 68.111,26.126C69.383,26.438 70.488,26.947 71.424,27.655C72.36,28.364 73.089,29.283 73.612,30.411C74.134,31.541 74.396,32.924 74.396,34.559C74.396,36.11 74.125,37.438 73.586,38.541C73.047,39.646 72.309,40.552 71.373,41.26C70.438,41.968 69.338,42.486 68.073,42.816C66.808,43.144 65.443,43.309 63.976,43.309L59.146,43.309L59.146,25.659L63.976,25.659L63.976,25.658ZM62.712,40.603L63.647,40.603C64.625,40.603 65.544,40.498 66.403,40.287C67.262,40.076 68.008,39.736 68.641,39.263C69.273,38.791 69.774,38.167 70.146,37.391C70.516,36.616 70.703,35.663 70.703,34.534C70.703,33.355 70.516,32.372 70.146,31.588C69.774,30.804 69.273,30.176 68.641,29.704C68.008,29.232 67.262,28.903 66.403,28.718C65.544,28.532 64.624,28.439 63.647,28.439L62.712,28.439L62.712,40.603Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13658" /><rect
|
||||
x="77.731"
|
||||
y="25.658"
|
||||
width="3.566"
|
||||
height="17.65"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="rect13660" /><path
|
||||
d="M97.051,25.658L100.264,25.658L100.264,43.308L95.762,43.308L91.236,34.66C91,34.222 90.759,33.745 90.515,33.231C90.271,32.718 90.03,32.211 89.794,31.714C89.558,31.217 89.343,30.749 89.148,30.311C88.955,29.873 88.798,29.51 88.681,29.223L88.63,29.223C88.647,29.493 88.663,29.877 88.681,30.373C88.698,30.871 88.709,31.406 88.719,31.979C88.727,32.552 88.736,33.117 88.743,33.674C88.752,34.229 88.757,34.694 88.757,35.064L88.757,43.308L85.544,43.308L85.544,25.658L90.3,25.658L94.75,34.382C94.919,34.702 95.112,35.09 95.332,35.545C95.551,36.001 95.774,36.472 96.003,36.961C96.23,37.451 96.445,37.927 96.647,38.39C96.85,38.854 97.017,39.237 97.154,39.54L97.204,39.54C97.186,39.22 97.17,38.786 97.154,38.239C97.136,37.69 97.12,37.105 97.103,36.48C97.085,35.857 97.073,35.241 97.065,34.634C97.055,34.028 97.051,33.505 97.051,33.067L97.051,25.658L97.051,25.658Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13662" /><path
|
||||
d="M118.242,29.324C117.701,29.038 117.013,28.803 116.176,28.616C115.34,28.431 114.465,28.338 113.554,28.338C112.607,28.338 111.754,28.481 110.993,28.767C110.233,29.053 109.587,29.456 109.055,29.978C108.522,30.5 108.109,31.139 107.812,31.896C107.517,32.653 107.369,33.494 107.369,34.42C107.369,35.329 107.505,36.161 107.775,36.919C108.045,37.675 108.439,38.319 108.955,38.849C109.471,39.379 110.109,39.791 110.87,40.086C111.631,40.381 112.502,40.527 113.483,40.527C113.854,40.527 114.222,40.506 114.586,40.464C114.949,40.422 115.275,40.359 115.563,40.275L115.563,35.899L111.795,35.899L111.795,33.067L118.951,33.067L118.951,42.55C117.99,42.887 117.013,43.127 116.017,43.27C115.023,43.413 114.02,43.485 113.008,43.485C111.659,43.485 110.407,43.279 109.252,42.865C108.098,42.452 107.099,41.854 106.256,41.07C105.413,40.286 104.756,39.334 104.283,38.213C103.811,37.092 103.575,35.824 103.575,34.407C103.575,33.042 103.811,31.807 104.283,30.703C104.756,29.599 105.426,28.659 106.294,27.884C107.162,27.108 108.212,26.514 109.442,26.101C110.671,25.688 112.055,25.481 113.588,25.481C114.465,25.481 115.321,25.531 116.155,25.632C116.99,25.734 117.768,25.911 118.494,26.163L118.242,29.324Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13664" /><g
|
||||
id="g13666"><rect
|
||||
x="9.05"
|
||||
y="50.073"
|
||||
width="4.968"
|
||||
height="24.584"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="rect13668" /><path
|
||||
d="M31.734,61.802C32.064,62.835 32.422,64.02 32.809,65.359C33.196,66.698 33.532,67.941 33.812,69.092L33.882,69.092C34.212,67.941 34.576,66.697 34.974,65.359C35.374,64.02 35.738,62.835 36.066,61.802L40.012,50.073L47.725,50.073L47.725,74.657L42.97,74.657L42.97,62.647C42.97,62.06 42.97,61.39 42.97,60.639C42.97,59.888 42.976,59.107 42.988,58.295C42.999,57.486 43.012,56.682 43.023,55.883C43.035,55.085 43.052,54.334 43.076,53.629L43.006,53.629C42.817,54.216 42.618,54.861 42.407,55.567C42.195,56.271 41.978,56.976 41.755,57.679C41.532,58.385 41.321,59.054 41.122,59.688C40.921,60.322 40.752,60.863 40.611,61.309L35.857,74.657L31.418,74.657L26.839,61.449C26.746,61.167 26.592,60.698 26.382,60.04C26.17,59.382 25.942,58.654 25.695,57.855C25.449,57.057 25.214,56.277 24.99,55.513C24.767,54.751 24.585,54.121 24.444,53.629L24.374,53.629C24.397,54.334 24.414,55.085 24.427,55.883C24.439,56.681 24.45,57.486 24.462,58.295C24.474,59.107 24.481,59.888 24.481,60.639L24.481,74.657L19.937,74.657L19.937,50.073L27.898,50.073L31.734,61.802Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13670" /><path
|
||||
d="M75.939,74.657L70.549,74.657L68.402,68.987L58.151,68.987L56.003,74.657L50.895,74.657L60.546,50.073L66.147,50.073L75.939,74.657ZM65.02,59.511C64.879,59.136 64.726,58.696 64.563,58.192C64.397,57.688 64.241,57.17 64.087,56.641C63.934,56.113 63.788,55.615 63.647,55.144C63.507,54.674 63.4,54.275 63.33,53.946L63.26,53.946C63.165,54.275 63.048,54.674 62.908,55.144C62.767,55.614 62.608,56.113 62.431,56.641C62.255,57.17 62.084,57.687 61.921,58.192C61.756,58.696 61.604,59.136 61.463,59.511L59.421,65.253L67.064,65.253L65.02,59.511Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13672" /><path
|
||||
d="M98.023,55.179C97.269,54.78 96.31,54.452 95.146,54.193C93.98,53.935 92.761,53.806 91.493,53.806C90.175,53.806 88.986,54.005 87.926,54.404C86.868,54.802 85.968,55.364 85.227,56.091C84.485,56.818 83.909,57.708 83.497,58.762C83.085,59.817 82.878,60.988 82.878,62.278C82.878,63.544 83.067,64.703 83.445,65.758C83.82,66.812 84.369,67.708 85.087,68.446C85.806,69.184 86.694,69.759 87.755,70.169C88.816,70.579 90.027,70.784 91.395,70.784C91.914,70.784 92.426,70.754 92.932,70.696C93.438,70.637 93.892,70.55 94.292,70.432L94.292,64.337L89.043,64.337L89.043,60.393L99.011,60.393L99.011,73.601C97.672,74.071 96.311,74.405 94.925,74.604C93.54,74.803 92.143,74.905 90.734,74.905C88.855,74.905 87.112,74.618 85.504,74.042C83.895,73.467 82.504,72.634 81.329,71.541C80.155,70.448 79.24,69.123 78.583,67.561C77.925,66 77.597,64.233 77.597,62.26C77.597,60.358 77.925,58.638 78.583,57.1C79.24,55.562 80.174,54.252 81.383,53.173C82.593,52.092 84.054,51.265 85.77,50.69C87.483,50.115 89.409,49.827 91.545,49.827C92.766,49.827 93.958,49.898 95.121,50.038C96.283,50.18 97.368,50.426 98.379,50.777L98.023,55.179Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13674" /><path
|
||||
d="M104.397,50.073L118.944,50.073L118.944,54.193L109.293,54.193L109.293,60.077L118.17,60.077L118.17,64.057L109.293,64.057L109.293,70.538L119.05,70.538L119.05,74.657L104.398,74.657L104.398,50.073L104.397,50.073Z"
|
||||
style="fill:#a9aaac;fill-rule:nonzero;fill-opacity:1"
|
||||
id="path13676" /></g></g></g></g></svg>
|
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue