@@ -40,45 +40,52 @@ Add -DSR25519_FORCE_32BIT to force the use of 32 bit routines even when compilin
40
40
cmake .. -DSR25519_FORCE_32BIT=true
41
41
#+END_SRC
42
42
43
+ * Test
44
+ #+BEGIN_SRC sh
45
+ ./sr25519DonnaTests
46
+ #+END_SRC
43
47
* Integration
48
+ [[https://github.com/TerenceGe/sr25519-donna/blob/954fc1ff50aa919a05b23e28695dc92cab510467/example/CMakeLists.txt#L13][example]]
44
49
#+BEGIN_SRC cmake
45
50
include_directories(../build/include/) # replace it with your sr25519-donna installed location if required
46
51
link_directories(../build/lib/) # replace it with your sr25519-donna installed location if required
47
52
48
53
add_executable(yourApp ${SOURCE_FILES})
49
54
target_link_libraries(yourApp libsr25519_donna.dylib) # replace it with libsr25519_donna_static.a if you want to use static lib.
50
55
51
- #+END_SRC
52
- * Test
53
- #+BEGIN_SRC sh
54
- ./sr25519DonnaTests
55
56
#+END_SRC
56
57
* Usage
57
58
** include
58
59
#+BEGIN_SRC C
59
60
#include "sr25519-donna.h"
60
61
#+END_SRC
61
62
** create keypair from seed
63
+ [[https://github.com/TerenceGe/sr25519-donna/blob/954fc1ff50aa919a05b23e28695dc92cab510467/example/src/main.c#L27][example]]
62
64
#+BEGIN_SRC C
63
65
void sr25519_keypair_from_seed(sr25519_keypair keypair, const sr25519_mini_secret_key seed);
64
66
#+END_SRC
65
67
** sign message
68
+ [[https://github.com/TerenceGe/sr25519-donna/blob/954fc1ff50aa919a05b23e28695dc92cab510467/example/src/main.c#L45][example]]
66
69
#+BEGIN_SRC C
67
70
void sr25519_sign(sr25519_signature signature, const sr25519_public_key public, const sr25519_secret_key secret, const uint8_t *message, unsigned long message_length);
68
71
#+END_SRC
69
72
** verify message
73
+ [[https://github.com/TerenceGe/sr25519-donna/blob/954fc1ff50aa919a05b23e28695dc92cab510467/example/src/main.c#L64][example]]
70
74
#+BEGIN_SRC C
71
75
bool sr25519_verify(const sr25519_signature signature, const uint8_t *message, unsigned long message_length, const sr25519_public_key public);
72
76
#+END_SRC
73
77
** soft derive keypair
78
+ [[https://github.com/TerenceGe/sr25519-donna/blob/954fc1ff50aa919a05b23e28695dc92cab510467/example/src/main.c#L77][example]]
74
79
#+BEGIN_SRC C
75
80
void sr25519_derive_keypair_soft(sr25519_keypair derived, const sr25519_keypair keypair, const sr25519_chain_code chain_code);
76
81
#+END_SRC
77
82
** soft derive public key
83
+ [[https://github.com/TerenceGe/sr25519-donna/blob/954fc1ff50aa919a05b23e28695dc92cab510467/example/src/main.c#L100][example]]
78
84
#+BEGIN_SRC C
79
85
void sr25519_derive_public_soft(sr25519_public_key derived_public, const sr25519_public_key public, const sr25519_chain_code chain_code);
80
86
#+END_SRC
81
87
** hard derive keypair
88
+ [[https://github.com/TerenceGe/sr25519-donna/blob/954fc1ff50aa919a05b23e28695dc92cab510467/example/src/main.c#L118][example]]
82
89
#+BEGIN_SRC C
83
90
void sr25519_derive_keypair_hard(sr25519_keypair derived, const sr25519_keypair keypair, const sr25519_chain_code chain_code);
84
91
#+END_SRC
0 commit comments