Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers randLIB_stub.c Source File

randLIB_stub.c

00001 /*
00002  * Copyright (c) 2014-2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 #include <stdint.h>
00018 #include <stdlib.h>
00019 #include <stdbool.h>
00020 #include <limits.h>
00021 #include "randLIB.h"
00022 #include "platform/arm_hal_random.h"
00023 
00024 #if ((RAND_MAX+1) & RAND_MAX) != 0
00025 #error "RAND_MAX isn't 2^n-1 :("
00026 #endif
00027 
00028 int counter = 1;
00029 
00030 void randLIB_seed_random(void)
00031 {
00032 }
00033 
00034 uint8_t randLIB_get_8bit(void)
00035 {
00036     return 0;
00037 }
00038 
00039 uint16_t randLIB_get_16bit(void)
00040 {
00041     return 0;
00042 }
00043 
00044 uint32_t randLIB_get_32bit(void)
00045 {
00046     return 0;
00047 }
00048 
00049 void *randLIB_get_n_bytes_random(void *data_ptr, uint8_t count)
00050 {
00051     if(data_ptr && count > 0){
00052         *((int*)data_ptr) = counter++%255;
00053     }
00054     return data_ptr;
00055 }
00056 
00057 uint16_t randLIB_get_random_in_range(uint16_t min, uint16_t max)
00058 {
00059     return 0;
00060 }
00061 
00062 uint32_t randLIB_randomise_base(uint32_t base, uint16_t min_factor, uint16_t max_factor)
00063 {
00064     return 0;
00065 }