mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-21 03:52:04 +00:00
mocks: fix shamir package
This commit is contained in:
parent
e69d98a533
commit
ffcb5e99cc
@ -25,8 +25,10 @@
|
|||||||
|
|
||||||
#define SHAMIR_MAX_SHARE_COUNT 16
|
#define SHAMIR_MAX_SHARE_COUNT 16
|
||||||
|
|
||||||
|
/// package: trezorcrypto.shamir
|
||||||
|
|
||||||
/// def interpolate(shares, x) -> bytes:
|
/// def interpolate(shares, x) -> bytes:
|
||||||
/// '''
|
/// """
|
||||||
/// Returns f(x) given the Shamir shares (x_1, f(x_1)), ... , (x_k, f(x_k)).
|
/// Returns f(x) given the Shamir shares (x_1, f(x_1)), ... , (x_k, f(x_k)).
|
||||||
/// :param shares: The Shamir shares.
|
/// :param shares: The Shamir shares.
|
||||||
/// :type shares: A list of pairs (x_i, y_i), where x_i is an integer and
|
/// :type shares: A list of pairs (x_i, y_i), where x_i is an integer and
|
||||||
@ -35,7 +37,7 @@
|
|||||||
/// :param int x: The x coordinate of the result.
|
/// :param int x: The x coordinate of the result.
|
||||||
/// :return: Evaluations of the polynomials in x.
|
/// :return: Evaluations of the polynomials in x.
|
||||||
/// :rtype: Array of bytes.
|
/// :rtype: Array of bytes.
|
||||||
/// '''
|
/// """
|
||||||
mp_obj_t mod_trezorcrypto_shamir_interpolate(mp_obj_t shares, mp_obj_t x) {
|
mp_obj_t mod_trezorcrypto_shamir_interpolate(mp_obj_t shares, mp_obj_t x) {
|
||||||
size_t share_count;
|
size_t share_count;
|
||||||
mp_obj_t *share_items;
|
mp_obj_t *share_items;
|
||||||
|
15
core/mocks/generated/trezorcrypto/shamir.py
Normal file
15
core/mocks/generated/trezorcrypto/shamir.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from typing import * # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
|
# extmod/modtrezorcrypto/modtrezorcrypto-shamir.h
|
||||||
|
def interpolate(shares, x) -> bytes:
|
||||||
|
"""
|
||||||
|
Returns f(x) given the Shamir shares (x_1, f(x_1)), ... , (x_k, f(x_k)).
|
||||||
|
:param shares: The Shamir shares.
|
||||||
|
:type shares: A list of pairs (x_i, y_i), where x_i is an integer and
|
||||||
|
y_i is an array of bytes representing the evaluations of the
|
||||||
|
polynomials in x_i.
|
||||||
|
:param int x: The x coordinate of the result.
|
||||||
|
:return: Evaluations of the polynomials in x.
|
||||||
|
:rtype: Array of bytes.
|
||||||
|
"""
|
Loading…
Reference in New Issue
Block a user