# SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. # SPDX-License-Identifier: GPL-3.0-or-later # # SPDX-FileCopyrightText: 2018 Coinkite, Inc. # SPDX-License-Identifier: GPL-3.0-only # # (c) Copyright 2018 by Coinkite Inc. This file is part of Coldcard # and is covered by GPLv3 license found in COPYING. # # callgate.py - Wrapper around system.dispatch() methods from se_commands import * from common import system # Fill buf with random bytes def fill_random(buf): system.dispatch(CMD_GET_RANDOM_BYTES, buf, 0) def get_is_bricked(): # see if we are a brick? return system.dispatch(CMD_IS_BRICKED, None, 0) != 0 def get_anti_phishing_words(pin_buf): return system.dispatch(CMD_GET_ANTI_PHISHING_WORDS, pin_buf, len(pin_buf)) def get_supply_chain_validation_words(buf): return system.dispatch(CMD_GET_SUPPLY_CHAIN_VALIDATION_WORDS, buf, len(buf)) # EOF