Commit 3867d5c7 authored by Jaromil's avatar Jaromil
Browse files

documentation updates

parent c037e881
......@@ -6,6 +6,11 @@ and their specific use-cases.
-faddress-sanitizers <- (check flags)
elements in multiplications that take ECP* and BIG should be checked
for position, for instance ECP multiplication needs to have the BIG
number always as second argument. Instead of returning error we should
check the type and reposition the arguments accordingly.
## Deterministic Random in the Checker
......@@ -21,7 +26,6 @@ the only random useful in EC are numbers in FP
and the FP is already modulus so smaller than the order
the only random needed is for generation of the private key
the private key is a random number smaller than the order of the curve
the public key is the scalar multiplication between G1 and the private key
......@@ -116,8 +120,11 @@ multiply group order by the generetor should give the point at infinity
## Generic improvements
- parse lib/milagro-crypto-c/cmake/AMCLParameters.cmake for info about
curves: size of BIG, names and pairing-friendliness
^ add tracking of single lua command/operations executions
- erlang style pattern matching on data structures
https://github.com/silentbicycle/tamale
- add brieflz2 compression
......@@ -126,11 +133,8 @@ multiply group order by the generetor should give the point at infinity
https://github.com/kallisti5/ElectricFence
https://github.com/Ryandev/MemoryTracker
- add tracking of single lua command/operations executions
- in/out to MSGPACK in addition to JSON for compact messaging easy using
Antirez' extension see https://github.com/antirez/lua-cmsgpack
- parse lib/milagro-crypto-c/cmake/AMCLParameters.cmake for info about
curves: size of BIG, names and pairing-friendliness
- add some more functions from stdlib's string and utils
https://github.com/lua-stdlib/lua-stdlib
......@@ -138,12 +142,12 @@ multiply group order by the generetor should give the point at infinity
- Include libs from penlight
http://stevedonovan.github.io/Penlight/api/index.html stringx, lexer
- erlang style pattern matching on data structures
https://github.com/silentbicycle/tamale
- date and time module
https://github.com/Tieske/date
X in/out to MSGPACK in addition to JSON for compact messaging easy using
Antirez' extension see https://github.com/antirez/lua-cmsgpack
V if event based callback framework needed, try including libev
https://github.com/brimworks/lua-ev
http://software.schmorp.de/pkg/libev.html
......@@ -172,14 +176,16 @@ V add a new 8bit memory manager to test
## Developer experience
- on error print out code at line where it has been detected
^ on error print out code at line where it has been detected
the line number is already included between semicolons
just need to go to script buffer and extract line
- !! make a Jupyter kernel for zenroom (-> Puria)
- improve Jupyter kernel for zenroom
- http://jupyter-client.readthedocs.io/en/latest/kernels.html
- https://github.com/neomantra/lua_ipython_kernel
- language server in lua (lsp branch) followup
- graphviz representation of complex data structures
http://siffiejoe.github.io/lua-microscope/
......@@ -205,9 +211,6 @@ X add list of functions and keywords for completion in ace
- Benchmark suite to measure capacity to de/code large amounts of
streaming data in chunks.
V Investigate adoption of LuaJit in place of Lua5.1
(should be easy as it seems the C api is pretty much the same)
## Security
- maybe support Linux kernel keystore feature for loaded keys
......@@ -220,9 +223,9 @@ X adopt a declarative approach to data schemes accepted in scripts
## Documentation
- Start sketching an high-level API based on experience in DECODE
^ Start sketching an high-level API based on experience in DECODE
- Provide cross-language examples for most basic operations
^ Provide cross-language examples for most basic operations
V Make it easy to integrate with BLOCKLY to generate simple
cryptographic functions.
......@@ -235,12 +238,12 @@ X Document api with luadoc http://keplerproject.github.io/luadoc/
## Crypto
^ Build a usable ABC implementation (maybe compatible with coconut
and/or IRMA?)
- see if ECDAA is any useful https://github.com/xaptum/ecdaa
has Direct Anonymous Attestation (DAA) and Schnorr sigs
- Build a usable ABC implementation (maybe compatible with coconut
and/or IRMA?)
- Reproduce tor's new onion address scheme
(see tor-dam/pkg/damlib/crypto_25519.go)
......
......@@ -25,6 +25,8 @@ template=true
backtick_references=false
file={
'../../src/zen_octet.c',
'../../src/zen_random.c',
'../../src/zen_hash.c',
'../../src/zen_ecdh.c',
'../../src/zen_ecp.c',
'../../src/zen_ecp2.c',
......
--------------
--- <h1>Advanced data manipulation</h1>
--- <h1>Advanced data manipulation (LAMBDA)</h1>
--
-- Manipulate complex data structures with functional programming
-- prototypes. This set of functions are ideal to work on nested
......@@ -16,7 +16,7 @@
-- @copyright 2012-2017
-- @license MIT
-- @release 1.6.1-zenroom
-- @module data
-- @module LAMBDA
local _MODULEVERSION = '1.6.1'
......
......@@ -18,6 +18,24 @@
* Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/// <h1>Cryptographic hash functions</h1>
//
// An hash is also known as 'message digest', 'digital fingerprint',
// 'digest' or 'checksum'.
//
// HASH objects can be generated from a number of implemented
// algorithms: `sha256` and `sha512`.
//
// objects are instantiated using @{HASH:new} and then provide the
// method @{HASH:process} that takes an input @{OCTET} and then
// returns another fixed-size octet that is uniquely matched to the
// original data. The process is not reversible (the original data
// cannot be retrieved from an hash).
//
// @module HASH
// @author Denis "Jaromil" Roio
// @license GPLv3
// @copyright Dyne.org foundation 2017-2018
#include <lua.h>
#include <lualib.h>
......@@ -52,6 +70,18 @@ typedef struct {
// ...
} HASH;
/**
Create a new hash object of a selected algorithm (sha256 or
sha512). The resulting object can then process any @{OCTET} into
its hashed equivalent.
@param string indicating the type of hash algorithm
@function HASH.new(string)
@return a new hash object ready to process data.
@see process
*/
HASH* hash_new(lua_State *L, const char *hashtype) {
HEREs(hashtype);
HASH *hash = (HASH*)lua_newuserdata(L, sizeof(HASH));
......
......@@ -21,15 +21,16 @@
/// <h1>Cryptographically Secure Random Number Generator (RNG)</h1>
//
// This method is initialised with a different seed upon creation.
// Each new RNG instance is initialised with a different random seed
//
// Cryptographic security is achieved by hashing the random numbers
// using this sequence: unguessable seed -> SHA -> PRNG internal state
// -> SHA -> random numbers. See <a
// href="ftp://ftp.rsasecurity.com/pub/pdfs/bull-1.pdf">this paper</a>
// for a justification.
// for an exstensive description of the process. More recent methods
// (fortuna etc) are in the works.
//
// @module rng
// @module RNG
// @author Denis "Jaromil" Roio
// @license GPLv3
// @copyright Dyne.org foundation 2017-2018
......@@ -79,9 +80,6 @@ RNG* rng_arg(lua_State *L, int n) {
return((RNG*)ud);
}
/// Global RNG extension
// @section rng.globals
static int newrng(lua_State *L) {
HERE();
RNG *rng = rng_new(L); SAFE(rng);
......@@ -89,7 +87,7 @@ static int newrng(lua_State *L) {
}
/***
Create a new octet of given lenght filled with random data.
Create a new @{OCTET} of given lenght filled with random data.
@param int length of random material in bytes
@function octet(int)
......@@ -106,6 +104,13 @@ int rng_oct(lua_State *L) {
return 1;
}
/***
Create a new @{BIG} of default @{ECP} curve length filled with random data.
@function big()
@usage
print( RNG.new():big():base64() )
*/
int rng_big(lua_State *L) {
RNG *rng = rng_arg(L,1); SAFE(rng);
big *res = big_new(L); SAFE(res);
......@@ -114,11 +119,12 @@ int rng_big(lua_State *L) {
}
/***
Returns a random BIG number reduced to modulo first argument,
removing bias.
Returns a random @{BIG} of default @{ECP} curve length reduced to
a modulus (another BIG number) and removing bias.
@function modbig(modulus)
@param modulus limit the big number to this modulus
@return a new randomg @{big} number
@return a new randomg @{BIG} number
*/
static int rng_modbig(lua_State *L) {
RNG *rng = rng_arg(L,1); SAFE(rng);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment