Compare commits

...

11 Commits

11 changed files with 382 additions and 1 deletions

View File

@ -0,0 +1,35 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_default_flags
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ------------------------------------------------------------------- |
| **Return type** | [`why2_input_flags`](../../../../types/core/flags/why2_input_flags) |
| **Header comment** | `THIS GENERATES why2_input_flags WITH DEFAULT VALUES` |
| **Added in commit** | [`71865826fa159e4480ecd676ff224822ea640506`](https://github.com/ENGO150/WHY2/commit/71865826fa159e4480ecd676ff224822ea640506) |
## Description
Returns default `input_flags` settings.

View File

@ -0,0 +1,37 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_default_memory_identifier
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ---------------------------------------------- |
| **Return type** | `char *` |
| **Header comment** | *This functions doesn't have any description.* |
| **Added in commit** | [`aa6b484363ad609f1bf1ff5ee539723d9417f48a`](https://github.com/ENGO150/WHY2/commit/aa6b484363ad609f1bf1ff5ee539723d9417f48a) |
## Description
Returns string, which is by default used in garbage collector for identifying (separating) nodes.
Every allocation has its own ID, which is set to lastly used `memory_identifier`. This separates allocations in code to blocks and you can run GC with the `memory_identifier` to deallocate those blocks.

View File

@ -0,0 +1,35 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_encryption_operation
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ------------------------------------------------------------------------------------------- |
| **Return type** | [`why2_encryption_operation_cb`](../../../../types/core/flags/why2_encryption_operation_cb) |
| **Header comment** | `RETURNS FUNCTION WHICH IS USED FOR ENCRYPTION & DECRYPTION` |
| **Added in commit** | [`2a09a38acf48f0e57beb5135ab7f1fdb18e088fa`](https://github.com/ENGO150/WHY2/commit/2a09a38acf48f0e57beb5135ab7f1fdb18e088fa) |
## Description
Returns callback to `encryption_operation`, which is used during encryption/decryption for final string manipulation.

View File

@ -0,0 +1,43 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_encryption_separator
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ---------------------------------------------- |
| **Return type** | `char` |
| **Header comment** | *This functions doesn't have any description.* |
| **Added in commit** | [`1a5b58edf99547ba32fb047e80fb179f315182b9`](https://github.com/ENGO150/WHY2/commit/1a5b58edf99547ba32fb047e80fb179f315182b9) |
## Description
Returns `encryption_separator`, which is used in encryption/decryption for separating chars.
---
```
104'-100'10306'-110'87
```
Example above uses `'` as `encryption_separator`.

View File

@ -0,0 +1,35 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_flags
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ------------------------------------------------------------------- |
| **Return type** | [`why2_input_flags`](../../../../types/core/flags/why2_input_flags) |
| **Header comment** | `RETURNS USED FLAGS` |
| **Added in commit** | [`692e76db175c2da444a5d92163305d26de73501a`](https://github.com/ENGO150/WHY2/commit/692e76db175c2da444a5d92163305d26de73501a) |
## Description
Returns used `input_flags` settings.

View File

@ -0,0 +1,35 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_flags_changed
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ----------------------------------------------------- |
| **Return type** | [`why2_bool`](../../../../types/core/flags/why2_bool) |
| **Header comment** | *This functions doesn't have any description.* |
| **Added in commit** | [`083233c0f64302621c915125fffec0d5e9b23a2c`](https://github.com/ENGO150/WHY2/commit/083233c0f64302621c915125fffec0d5e9b23a2c) |
## Description
Function returns boolean &#8594; whether [`why2_set_flags`](../../setters/why2_set_flags) was used or not.

View File

@ -0,0 +1,35 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_key_length
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ---------------------------------------------- |
| **Return type** | `unsigned long` |
| **Header comment** | *This functions doesn't have any description.* |
| **Added in commit** | [`e85a14b2530d6c8a39be946f691a0f9047d38f73`](https://github.com/ENGO150/WHY2/commit/e85a14b2530d6c8a39be946f691a0f9047d38f73) |
## Description
Returns `key_length`, which is used in `key` generation. Also works as minimal length of `key` passed in [`why2_encrypt_text`](../../../encrypter/why2_encrypt_text).

View File

@ -0,0 +1,37 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_memory_identifier
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ---------------------------------------------- |
| **Return type** | `char *` |
| **Header comment** | `RETURNS STRING USED IN LINKED LIST (IN memory.c) FOR IDENTIFYING NODES WHEN RUNNING GARBAGE COLLECTOR` |
| **Added in commit** | [`70335e67ad3e7ef3bc693741a03cb91962b91863`](https://github.com/ENGO150/WHY2/commit/70335e67ad3e7ef3bc693741a03cb91962b91863) |
## Description
Returns string, which is used in garbage collector for identifying (separating) nodes.
Every allocation has its own ID, which is set to lastly used `memory_identifier`. This separates allocations in code to blocks and you can run GC with the `memory_identifier` to deallocate those blocks.

View File

@ -0,0 +1,35 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_get_padding_changed
## Parameters
*This functions doesn't take any parameters.*
## Attributes
| | |
| ------------------ | ----------------------------------------------------- |
| **Return type** | [`why2_bool`](../../../../types/core/flags/why2_bool) |
| **Header comment** | *This functions doesn't have any description.* |
| **Added in commit** | [`59d6252fe37f036995cb23f3b9898ee1c4b4428d`](https://github.com/ENGO150/WHY2/commit/59d6252fe37f036995cb23f3b9898ee1c4b4428d) |
## Description
Function returns boolean &#8594; whether [`why2_set_padding`](../../setters/why2_set_padding) was used or not.

View File

@ -0,0 +1,37 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_no_output
## Parameters
| Identifier | Data type |
| ----------- | ---------------------------------------------------------------------- |
| `exit_code` | [`enum WHY2_EXIT_CODES`](../../../../enums/core/flags/why2_exit_codes) |
## Attributes
| | |
| ------------------ | --------------------------------------------------------------------- |
| **Return type** | [`why2_output_flags`](../../../../types/core/flags/why2_output_flags) |
| **Header comment** | `SAME AS why2_get_default_flags() BUT FOR why2_output_flags` |
| **Added in commit** | [`c5de589fff870bbd8cf428465ea4e73caa3e8b38`](https://github.com/ENGO150/WHY2/commit/c5de589fff870bbd8cf428465ea4e73caa3e8b38) |
## Description
Returns empty `output_flags` with `exit_code`.

View File

@ -29,7 +29,7 @@ You can find documentation for every *public* function of WHY2 below.
| [`why2_sum_segment`](./core/crypto/why2_sum_segment) | Calculate SUM++ for input; Used for padding seed | | [`why2_sum_segment`](./core/crypto/why2_sum_segment) | Calculate SUM++ for input; Used for padding seed |
| [`why2_random`](./core/crypto/why2_random) | Write crypto-secure random number into dest | | [`why2_random`](./core/crypto/why2_random) | Write crypto-secure random number into dest |
| [`why2_seed_random`](./core/crypto/why2_seed_random) | Seed why2_seeded_random output | | [`why2_seed_random`](./core/crypto/why2_seed_random) | Seed why2_seeded_random output |
| [`why2_seeded_random`](./core/crypto/why2_seeded_random) | GENERATE RANDOM NUMBER BASED ON SEED PASSED IN why2_seed_random | | [`why2_seeded_random`](./core/crypto/why2_seeded_random) | Generate random number based on seed passed in why2_seed_random |
### Decrypter ### Decrypter
@ -43,6 +43,23 @@ You can find documentation for every *public* function of WHY2 below.
| --------------------------------------------------------- | ------------------------------------------------- | | --------------------------------------------------------- | ------------------------------------------------- |
| [`why2_encrypt_text`](./core/encrypter/why2_encrypt_text) | Text from will be encrypted with key and returned | | [`why2_encrypt_text`](./core/encrypter/why2_encrypt_text) | Text from will be encrypted with key and returned |
### Flags
#### Getters
| Function | Description |
| ----------------------------------------------------------------------------- | --------------------------------------- |
| [`why2_get_encryption_separator`](./core/flags/getters/why2_get_encryption_separator) | *This functions doesn't have any description.* |
| [`why2_get_key_length`](./core/flags/getters/why2_get_key_length) | *This functions doesn't have any description.* |
| [`why2_get_default_flags`](./core/flags/getters/why2_get_default_flags) | This generates why2_input_flags with default values |
| [`why2_get_flags`](./core/flags/getters/why2_get_flags) | Returns used flags |
| [`why2_no_output`](./core/flags/getters/why2_no_output) | Same as why2_get_default_flags() but for why2_output_flags |
| [`why2_get_encryption_operation`](./core/flags/getters/why2_get_encryption_operation) | Returns functions which is used for encryption & decryption |
| [`why2_get_flags_changed`](./core/flags/getters/why2_get_flags_changed) | *This functions doesn't have any description.* |
| [`why2_get_padding_changed`](./core/flags/getters/why2_get_padding_changed) | *This functions doesn't have any description.* |
| [`why2_get_memory_identifier`](./core/flags/getters/why2_get_memory_identifier) | Returns string used in linked list (in memory.c) for identifying nodes when running garbage collector |
| [`why2_get_default_memory_identifier`](./core/flags/getters/why2_get_default_memory_identifier) | *This functions doesn't have any description.* |
## Logger ## Logger
## Chat ## Chat