mirror of
https://github.com/CPunch/Laika.git
synced 2025-09-27 20:30:12 +00:00
Added lsodium.c, laikaK_loadKeys, laikaK_genKeys
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#ifndef LAIKA_CONFIG_H
|
||||
#define LAIKA_CONFIG_H
|
||||
|
||||
/* version info */
|
||||
#define LAIKA_VERSION_MAJOR 0
|
||||
#define LAIKA_VERSION_MINOR 1
|
||||
|
||||
/* keys */
|
||||
#define LAIKA_PUBKEY "40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27"
|
||||
#define LAIKA_PRIVKEY "90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc"
|
||||
#define LAIKA_CNC_IP "127.0.0.1"
|
||||
#define LAIKA_CNC_PORT "13337"
|
||||
|
||||
#endif
|
||||
#ifndef LAIKA_CONFIG_H
|
||||
#define LAIKA_CONFIG_H
|
||||
|
||||
/* version info */
|
||||
#define LAIKA_VERSION_MAJOR 0
|
||||
#define LAIKA_VERSION_MINOR 1
|
||||
|
||||
/* keys */
|
||||
#define LAIKA_PUBKEY "40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27"
|
||||
#define LAIKA_PRIVKEY "90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc"
|
||||
#define LAIKA_CNC_IP "127.0.0.1"
|
||||
#define LAIKA_CNC_PORT "13337"
|
||||
|
||||
#endif
|
||||
|
@@ -3,6 +3,11 @@
|
||||
|
||||
#include "sodium.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#define LAIKAENC_SIZE(sz) (sz + crypto_box_SEALBYTES)
|
||||
|
||||
bool laikaK_loadKeys(uint8_t *outPub, uint8_t *outPriv, const char *inPub, const char *inPriv);
|
||||
bool laikaK_genKeys(uint8_t *outPub, uint8_t *outPriv);
|
||||
|
||||
#endif
|
||||
|
@@ -29,10 +29,12 @@ struct sLaika_vm {
|
||||
int pc;
|
||||
};
|
||||
|
||||
#define LAIKA_MAKE_VM_INT(i) (struct sLaika_vm_val)({.i = i})
|
||||
#define LAIKA_MAKE_VM_PTR(ptr) (struct sLaika_vm_val)({.ptr = ptr})
|
||||
#define LAIKA_MAKE_VM(consts, code) (struct sLaika_vm)({.constList = consts, .code = code, .pc = 0})
|
||||
|
||||
/* constants */
|
||||
#define LAIKA_MAKE_VM_INT(i) (struct sLaika_vm_val)({.i = i})
|
||||
#define LAIKA_MAKE_VM_PTR(ptr) (struct sLaika_vm_val)({.ptr = ptr})
|
||||
/* instructions */
|
||||
#define LAIKA_MAKE_VM_IA(opcode, a) opcode, a
|
||||
#define LAIKA_MAKE_VM_IAB(opcode, a, b) opcode, a, b
|
||||
#define LAIKA_MAKE_VM_IABC(opcode, a, b, c) opcode, a, b, c
|
||||
@@ -63,7 +65,7 @@ inline void laikaV_execute(struct sLaika_vm *vm) {
|
||||
uint8_t a = READBYTE; \
|
||||
uint8_t b = READBYTE; \
|
||||
uint8_t c = READBYTE; \
|
||||
vm->stack[a] = vm->stack[b].i x vm->stack[c].i; \
|
||||
vm->stack[a].i = vm->stack[b].i x vm->stack[c].i; \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user