Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 1 | /* |
Nik Dewally | bacae6c | 2024-07-30 16:58:14 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2019-2024, Arm Limited. All rights reserved. |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * sec-regress.c&.h implement the Scripted-Call Application, and other functions |
| 10 | * for the security-regression testing feature. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef GIBBERISH_HPP |
| 15 | #define GIBBERISH_HPP |
| 16 | |
| 17 | #include <cstdlib> |
Nik Dewally | bacae6c | 2024-07-30 16:58:14 +0100 | [diff] [blame^] | 18 | #include <string> |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 19 | |
| 20 | using namespace std; |
| 21 | |
| 22 | class gibberish |
| 23 | { |
| 24 | public: // not much value in hiding these behind getters and setters |
| 25 | // Data members: |
| 26 | static const int min_literal_data_len = 32, max_literal_data_len = 512, |
| 27 | literal_data_len_span = max_literal_data_len - min_literal_data_len; |
| 28 | // Methods: |
| 29 | gibberish (void); // (constructor) |
| 30 | ~gibberish (void); |
| 31 | char letter (void); |
| 32 | char vowel (void); |
| 33 | char consonant (void); |
| 34 | char *syllable (char *string_ptr, char *stop); |
| 35 | char *word (bool initial_cap, char *string_ptr, char *stop); |
| 36 | int pick_sentence_len (void); |
| 37 | void sentence (char *string_ptr, char *stop); |
| 38 | |
| 39 | protected: |
| 40 | // Data members: |
| 41 | // Methods: |
| 42 | |
| 43 | private: |
| 44 | // Data members: |
| 45 | static const int n_avoids = 42; |
| 46 | string avoid[n_avoids] = {"bvup", "epvcmf", "jou", "tusvdu", "dpotu", "gmpbu", |
| 47 | "tipsu", "votjhofe", "csfbl", "fmtf", "mpoh", "txjudi", |
| 48 | "gvdl", "dpoujovf", "gps", "wbhjob", "tjhofe", "dpdl", |
| 49 | "wpje", "dbtf", "tiju", "fovn", "qfojt", "sfhjtufs", |
| 50 | "qjtt", "uzqfefg", "efgbvmu", "ujut", "hpup", "tj{fpg", |
| 51 | "uxbu", "wpmbujmf", "dvou", "dibs", "fyufso", "sfuvso", |
| 52 | "dpjuvt", "vojpo", "ep", "jg", "tubujd", "xijmf"}; |
| 53 | static const bool capitalize = true; |
| 54 | static const bool dont_capitalize = false; |
| 55 | // Parameters of random SST-asset generation: |
| 56 | // Methods: |
| 57 | }; |
| 58 | |
| 59 | #endif /* GIBBERISH_HPP */ |