Vadim Bendebury | 0a05071 | 2015-05-29 11:35:04 -0700 | [diff] [blame^] | 1 | /* |
| 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 | |
| 10 | LIB_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 | ); |
| 16 | LIB_EXPORT UINT16 _math__Normalize2B( |
| 17 | TPM2B *b // IN/OUT: number to normalize |
| 18 | ); |
| 19 | LIB_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 | ); |
| 27 | LIB_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 |