Initial commit

This commit is contained in:
2024-04-03 12:48:01 +02:00
commit 8c9c0feb49
7 changed files with 53 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
build

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "libjade"]
path = libjade
url = https://github.com/formosa-crypto/libjade.git

20
Makefile Normal file
View File

@@ -0,0 +1,20 @@
JC ?= jasminc
CC ?= gcc
MAKE ?= make
.PHONY: clean run
all: build
@true
build: build/agent.S
$(CC) build/agent.S -o build/agent
clean:
rm build/* 2> /dev/null || true
build/%.S: src/%.jazz
JASMINPATH="Jade=libjade/src/" $(JC) $< -o $@
run: build
build/agent

0
build/.gitkeep Normal file
View File

21
default.nix Normal file
View File

@@ -0,0 +1,21 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
jasmin-src = fetchFromGitHub {
owner = "jasmin-lang";
repo = "jasmin";
rev = "9bb6340fe0e3c5d78ea3957f6c5c3564c3424770";
hash = "sha256-EVwnD6dZLTy9MgR6gdymhg3Ipudpj1mchDlMpCAdITE=";
};
jasmin = callPackage "${jasmin-src}/default.nix" { inherit pkgs; };
in
stdenv.mkDerivation {
name = "x25519-agent";
nativeBuildInputs = [
gnumake
gcc
jasmin
];
}

1
libjade Submodule

Submodule libjade added at c1c7516c45

7
src/agent.jazz Normal file
View File

@@ -0,0 +1,7 @@
from Jade require "crypto_scalarmult/curve25519/amd64/mulx/curve25519.jinc"
export fn main(reg u64 p) -> reg u64 {
reg u64 ret;
ret = 0;
return ret;
}