-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Haskell bindings to new C crypto jets.
- Loading branch information
1 parent
539a30d
commit 7fa0a11
Showing
4 changed files
with
214 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,54 @@ | ||
#include "jets.h" | ||
|
||
bool c_add_32(frameItem* dst, const frameItem *src) { | ||
return add_32(dst, *src, NULL); | ||
#define WRAP_(jet) \ | ||
bool c_##jet(frameItem* dst, const frameItem* src) { \ | ||
return jet(dst, *src, NULL); \ | ||
} | ||
|
||
bool c_full_add_32(frameItem* dst, const frameItem *src) { | ||
return full_add_32(dst, *src, NULL); | ||
} | ||
WRAP_(add_32) | ||
WRAP_(full_add_32) | ||
WRAP_(subtract_32) | ||
WRAP_(full_subtract_32) | ||
WRAP_(multiply_32) | ||
WRAP_(full_multiply_32) | ||
|
||
bool c_subtract_32(frameItem* dst, const frameItem *src) { | ||
return subtract_32(dst, *src, NULL); | ||
} | ||
WRAP_(sha_256_block) | ||
|
||
bool c_full_subtract_32(frameItem* dst, const frameItem *src) { | ||
return full_subtract_32(dst, *src, NULL); | ||
} | ||
|
||
bool c_multiply_32(frameItem* dst, const frameItem *src) { | ||
return multiply_32(dst, *src, NULL); | ||
} | ||
|
||
bool c_full_multiply_32(frameItem* dst, const frameItem *src) { | ||
return full_multiply_32(dst, *src, NULL); | ||
} | ||
|
||
bool c_sha_256_block(frameItem* dst, const frameItem* src) { | ||
return sha_256_block(dst, *src, NULL); | ||
} | ||
WRAP_(fe_normalize) | ||
WRAP_(fe_negate) | ||
WRAP_(fe_add) | ||
WRAP_(fe_square) | ||
WRAP_(fe_multiply) | ||
WRAP_(fe_multiply_beta) | ||
WRAP_(fe_invert) | ||
WRAP_(fe_square_root) | ||
WRAP_(fe_is_zero) | ||
WRAP_(fe_is_odd) | ||
WRAP_(scalar_normalize) | ||
WRAP_(scalar_negate) | ||
WRAP_(scalar_add) | ||
WRAP_(scalar_square) | ||
WRAP_(scalar_multiply) | ||
WRAP_(scalar_multiply_lambda) | ||
WRAP_(scalar_invert) | ||
WRAP_(scalar_is_zero) | ||
WRAP_(gej_infinity) | ||
WRAP_(gej_normalize) | ||
WRAP_(gej_negate) | ||
WRAP_(ge_negate) | ||
WRAP_(gej_double) | ||
WRAP_(gej_add) | ||
WRAP_(gej_ge_add_ex) | ||
WRAP_(gej_ge_add) | ||
WRAP_(gej_is_infinity) | ||
WRAP_(gej_x_equiv) | ||
WRAP_(gej_y_is_odd) | ||
WRAP_(gej_is_on_curve) | ||
WRAP_(ge_is_on_curve) | ||
WRAP_(scale) | ||
WRAP_(generate) | ||
WRAP_(linear_combination_1) | ||
WRAP_(linear_verify_1) | ||
WRAP_(decompress) | ||
WRAP_(point_verify_1) | ||
WRAP_(bip0340_verify) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters