blob: e7c22e8f435b5cce88a2d21f2cf88b4a4234b316 [file] [log] [blame]
Vadim Bendebury0a050712015-05-29 11:35:04 -07001/*
2 * Copyright 2015 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifndef __TPM2_MATHFUNCTIONS_FP_H
8#define __TPM2_MATHFUNCTIONS_FP_H
9
10LIB_EXPORT CRYPT_RESULT _math__Div(
11 const TPM2B *n, // IN: numerator
12 const TPM2B *d, // IN: denominator
13 TPM2B *q, // OUT: quotient
14 TPM2B *r // OUT: remainder
15 );
16LIB_EXPORT UINT16 _math__Normalize2B(
17 TPM2B *b // IN/OUT: number to normalize
18);
19LIB_EXPORT int _math__sub(
20 const UINT32 aSize, // IN: size of a
21 const BYTE *a, // IN: a
22 const UINT32 bSize, // IN: size of b
23 const BYTE *b, // IN: b
24 UINT16 *cSize, // OUT: set to MAX(aSize, bSize)
25 BYTE *c // OUT: the difference
26);
27LIB_EXPORT int _math__uComp(
28 const UINT32 aSize, // IN: size of a
29 const BYTE *a, // IN: a
30 const UINT32 bSize, // IN: size of b
31 const BYTE *b // IN: b
32 );
33
34#endif // __TPM2_MATHFUNCTIONS_FP_H