Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 1 | /* |
Janos Follath | a95f204 | 2022-08-19 12:09:17 +0100 | [diff] [blame] | 2 | * Core bignum functions |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 3 | * |
| 4 | * Copyright The Mbed TLS Contributors |
| 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | * not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | */ |
| 19 | |
| 20 | #include "common.h" |
| 21 | |
| 22 | #if defined(MBEDTLS_BIGNUM_C) |
| 23 | |
| 24 | #include <string.h> |
| 25 | |
| 26 | #include "mbedtls/error.h" |
| 27 | #include "mbedtls/platform_util.h" |
| 28 | |
| 29 | #if defined(MBEDTLS_PLATFORM_C) |
| 30 | #include "mbedtls/platform.h" |
| 31 | #else |
| 32 | #include <stdio.h> |
| 33 | #include <stdlib.h> |
| 34 | #define mbedtls_printf printf |
| 35 | #define mbedtls_calloc calloc |
| 36 | #define mbedtls_free free |
| 37 | #endif |
| 38 | |
| 39 | #include "bignum_core.h" |
| 40 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 41 | size_t mbedtls_mpi_core_clz( const mbedtls_mpi_uint a ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 42 | { |
| 43 | size_t j; |
| 44 | mbedtls_mpi_uint mask = (mbedtls_mpi_uint) 1 << (biL - 1); |
| 45 | |
| 46 | for( j = 0; j < biL; j++ ) |
| 47 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 48 | if( a & mask ) break; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 49 | |
| 50 | mask >>= 1; |
| 51 | } |
| 52 | |
Gabor Mezei | 89e3146 | 2022-08-12 15:36:56 +0200 | [diff] [blame] | 53 | return( j ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 54 | } |
| 55 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 56 | size_t mbedtls_mpi_core_bitlen( const mbedtls_mpi_uint *A, size_t A_limbs ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 57 | { |
| 58 | size_t i, j; |
| 59 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 60 | if( A_limbs == 0 ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 61 | return( 0 ); |
| 62 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 63 | for( i = A_limbs - 1; i > 0; i-- ) |
| 64 | if( A[i] != 0 ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 65 | break; |
| 66 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 67 | j = biL - mbedtls_mpi_core_clz( A[i] ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 68 | |
| 69 | return( ( i * biL ) + j ); |
| 70 | } |
| 71 | |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 72 | /* Convert a big-endian byte array aligned to the size of mbedtls_mpi_uint |
| 73 | * into the storage form used by mbedtls_mpi. */ |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 74 | static mbedtls_mpi_uint mpi_bigendian_to_host_c( mbedtls_mpi_uint a ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 75 | { |
| 76 | uint8_t i; |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 77 | unsigned char *a_ptr; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 78 | mbedtls_mpi_uint tmp = 0; |
| 79 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 80 | for( i = 0, a_ptr = (unsigned char *) &a; i < ciL; i++, a_ptr++ ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 81 | { |
| 82 | tmp <<= CHAR_BIT; |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 83 | tmp |= (mbedtls_mpi_uint) *a_ptr; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | return( tmp ); |
| 87 | } |
| 88 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 89 | static mbedtls_mpi_uint mpi_bigendian_to_host( mbedtls_mpi_uint a ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 90 | { |
| 91 | #if defined(__BYTE_ORDER__) |
| 92 | |
| 93 | /* Nothing to do on bigendian systems. */ |
| 94 | #if ( __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ) |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 95 | return( a ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 96 | #endif /* __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ */ |
| 97 | |
| 98 | #if ( __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ) |
| 99 | |
| 100 | /* For GCC and Clang, have builtins for byte swapping. */ |
| 101 | #if defined(__GNUC__) && defined(__GNUC_PREREQ) |
| 102 | #if __GNUC_PREREQ(4,3) |
| 103 | #define have_bswap |
| 104 | #endif |
| 105 | #endif |
| 106 | |
| 107 | #if defined(__clang__) && defined(__has_builtin) |
| 108 | #if __has_builtin(__builtin_bswap32) && \ |
| 109 | __has_builtin(__builtin_bswap64) |
| 110 | #define have_bswap |
| 111 | #endif |
| 112 | #endif |
| 113 | |
| 114 | #if defined(have_bswap) |
| 115 | /* The compiler is hopefully able to statically evaluate this! */ |
| 116 | switch( sizeof(mbedtls_mpi_uint) ) |
| 117 | { |
| 118 | case 4: |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 119 | return( __builtin_bswap32(a) ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 120 | case 8: |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 121 | return( __builtin_bswap64(a) ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 122 | } |
| 123 | #endif |
| 124 | #endif /* __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ */ |
| 125 | #endif /* __BYTE_ORDER__ */ |
| 126 | |
| 127 | /* Fall back to C-based reordering if we don't know the byte order |
| 128 | * or we couldn't use a compiler-specific builtin. */ |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 129 | return( mpi_bigendian_to_host_c( a ) ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 130 | } |
| 131 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 132 | void mbedtls_mpi_core_bigendian_to_host( mbedtls_mpi_uint *A, |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 133 | size_t limbs ) |
| 134 | { |
| 135 | mbedtls_mpi_uint *cur_limb_left; |
| 136 | mbedtls_mpi_uint *cur_limb_right; |
| 137 | if( limbs == 0 ) |
| 138 | return; |
| 139 | |
| 140 | /* |
| 141 | * Traverse limbs and |
| 142 | * - adapt byte-order in each limb |
| 143 | * - swap the limbs themselves. |
| 144 | * For that, simultaneously traverse the limbs from left to right |
| 145 | * and from right to left, as long as the left index is not bigger |
| 146 | * than the right index (it's not a problem if limbs is odd and the |
| 147 | * indices coincide in the last iteration). |
| 148 | */ |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 149 | for( cur_limb_left = A, cur_limb_right = A + ( limbs - 1 ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 150 | cur_limb_left <= cur_limb_right; |
| 151 | cur_limb_left++, cur_limb_right-- ) |
| 152 | { |
| 153 | mbedtls_mpi_uint tmp; |
| 154 | /* Note that if cur_limb_left == cur_limb_right, |
| 155 | * this code effectively swaps the bytes only once. */ |
| 156 | tmp = mpi_bigendian_to_host( *cur_limb_left ); |
| 157 | *cur_limb_left = mpi_bigendian_to_host( *cur_limb_right ); |
| 158 | *cur_limb_right = tmp; |
| 159 | } |
| 160 | } |
| 161 | |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 162 | int mbedtls_mpi_core_read_le( mbedtls_mpi_uint *X, |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 163 | size_t X_limbs, |
| 164 | const unsigned char *input, |
| 165 | size_t input_length ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 166 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 167 | const size_t limbs = CHARS_TO_LIMBS( input_length ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 168 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 169 | if( X_limbs < limbs ) |
Janos Follath | 2ab2d3e | 2022-08-11 16:13:53 +0100 | [diff] [blame] | 170 | return( MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL ); |
| 171 | |
| 172 | if( X != NULL ) |
Gabor Mezei | bf9da1d | 2022-08-12 14:11:56 +0200 | [diff] [blame] | 173 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 174 | memset( X, 0, X_limbs * ciL ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 175 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 176 | for( size_t i = 0; i < input_length; i++ ) |
Janos Follath | ca5688e | 2022-08-19 12:05:28 +0100 | [diff] [blame] | 177 | { |
| 178 | size_t offset = ( ( i % ciL ) << 3 ); |
| 179 | X[i / ciL] |= ( (mbedtls_mpi_uint) input[i] ) << offset; |
| 180 | } |
Gabor Mezei | bf9da1d | 2022-08-12 14:11:56 +0200 | [diff] [blame] | 181 | } |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 182 | |
Janos Follath | 2ab2d3e | 2022-08-11 16:13:53 +0100 | [diff] [blame] | 183 | return( 0 ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 184 | } |
| 185 | |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 186 | int mbedtls_mpi_core_read_be( mbedtls_mpi_uint *X, |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 187 | size_t X_limbs, |
| 188 | const unsigned char *input, |
| 189 | size_t input_length ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 190 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 191 | const size_t limbs = CHARS_TO_LIMBS( input_length ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 192 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 193 | if( X_limbs < limbs ) |
Janos Follath | 2ab2d3e | 2022-08-11 16:13:53 +0100 | [diff] [blame] | 194 | return( MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL ); |
| 195 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 196 | /* If X_limbs is 0, input_length must also be 0 (from previous test). |
| 197 | * Nothing to do. */ |
| 198 | if( X_limbs == 0 ) |
Gabor Mezei | c414ba3 | 2022-08-12 17:47:39 +0200 | [diff] [blame] | 199 | return( 0 ); |
| 200 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 201 | memset( X, 0, X_limbs * ciL ); |
Gabor Mezei | c414ba3 | 2022-08-12 17:47:39 +0200 | [diff] [blame] | 202 | |
| 203 | /* memcpy() with (NULL, 0) is undefined behaviour */ |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 204 | if( input_length != 0 ) |
Gabor Mezei | bf9da1d | 2022-08-12 14:11:56 +0200 | [diff] [blame] | 205 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 206 | size_t overhead = ( X_limbs * ciL ) - input_length; |
Gabor Mezei | c414ba3 | 2022-08-12 17:47:39 +0200 | [diff] [blame] | 207 | unsigned char *Xp = (unsigned char *) X; |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 208 | memcpy( Xp + overhead, input, input_length ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 209 | } |
| 210 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 211 | mbedtls_mpi_core_bigendian_to_host( X, X_limbs ); |
Gabor Mezei | c414ba3 | 2022-08-12 17:47:39 +0200 | [diff] [blame] | 212 | |
Janos Follath | 2ab2d3e | 2022-08-11 16:13:53 +0100 | [diff] [blame] | 213 | return( 0 ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 214 | } |
| 215 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 216 | int mbedtls_mpi_core_write_le( const mbedtls_mpi_uint *A, |
| 217 | size_t A_limbs, |
| 218 | unsigned char *output, |
| 219 | size_t output_length ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 220 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 221 | size_t stored_bytes = A_limbs * ciL; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 222 | size_t bytes_to_copy; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 223 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 224 | if( stored_bytes < output_length ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 225 | { |
| 226 | bytes_to_copy = stored_bytes; |
| 227 | } |
| 228 | else |
| 229 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 230 | bytes_to_copy = output_length; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 231 | |
Janos Follath | af3f39c | 2022-08-22 09:06:32 +0100 | [diff] [blame^] | 232 | /* The output buffer is smaller than the allocated size of A. |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 233 | * However A may fit if its leading bytes are zero. */ |
Janos Follath | cc93908 | 2022-08-15 12:08:49 +0100 | [diff] [blame] | 234 | for( size_t i = bytes_to_copy; i < stored_bytes; i++ ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 235 | { |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 236 | if( GET_BYTE( A, i ) != 0 ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 237 | return( MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL ); |
| 238 | } |
| 239 | } |
| 240 | |
Janos Follath | cc93908 | 2022-08-15 12:08:49 +0100 | [diff] [blame] | 241 | for( size_t i = 0; i < bytes_to_copy; i++ ) |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 242 | output[i] = GET_BYTE( A, i ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 243 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 244 | if( stored_bytes < output_length ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 245 | { |
| 246 | /* Write trailing 0 bytes */ |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 247 | memset( output + stored_bytes, 0, output_length - stored_bytes ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | return( 0 ); |
| 251 | } |
| 252 | |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 253 | int mbedtls_mpi_core_write_be( const mbedtls_mpi_uint *X, |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 254 | size_t X_limbs, |
| 255 | unsigned char *output, |
| 256 | size_t output_length ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 257 | { |
| 258 | size_t stored_bytes; |
| 259 | size_t bytes_to_copy; |
| 260 | unsigned char *p; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 261 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 262 | stored_bytes = X_limbs * ciL; |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 263 | |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 264 | if( stored_bytes < output_length ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 265 | { |
Janos Follath | af3f39c | 2022-08-22 09:06:32 +0100 | [diff] [blame^] | 266 | /* There is enough space in the output buffer. Write initial |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 267 | * null bytes and record the position at which to start |
| 268 | * writing the significant bytes. In this case, the execution |
| 269 | * trace of this function does not depend on the value of the |
| 270 | * number. */ |
| 271 | bytes_to_copy = stored_bytes; |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 272 | p = output + output_length - stored_bytes; |
| 273 | memset( output, 0, output_length - stored_bytes ); |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 274 | } |
| 275 | else |
| 276 | { |
Janos Follath | af3f39c | 2022-08-22 09:06:32 +0100 | [diff] [blame^] | 277 | /* The output buffer is smaller than the allocated size of X. |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 278 | * However X may fit if its leading bytes are zero. */ |
Janos Follath | b7a88ec | 2022-08-19 12:24:40 +0100 | [diff] [blame] | 279 | bytes_to_copy = output_length; |
| 280 | p = output; |
Janos Follath | cc93908 | 2022-08-15 12:08:49 +0100 | [diff] [blame] | 281 | for( size_t i = bytes_to_copy; i < stored_bytes; i++ ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 282 | { |
| 283 | if( GET_BYTE( X, i ) != 0 ) |
| 284 | return( MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL ); |
| 285 | } |
| 286 | } |
| 287 | |
Janos Follath | cc93908 | 2022-08-15 12:08:49 +0100 | [diff] [blame] | 288 | for( size_t i = 0; i < bytes_to_copy; i++ ) |
Janos Follath | 3ca0775 | 2022-08-09 11:45:47 +0100 | [diff] [blame] | 289 | p[bytes_to_copy - i - 1] = GET_BYTE( X, i ); |
| 290 | |
| 291 | return( 0 ); |
| 292 | } |
| 293 | |
| 294 | #endif /* MBEDTLS_BIGNUM_C */ |