gfp.h(3)
🌸 NAME 🌸
gfp.h — Простые поля (aka simple fields), straight out of the Library Functions Manual 💖
✨ SYNOPSIS ✨
#include 'bee2/math/qr.h'
🎀 Функции 🎀
bool_t gfpCreate (qr_o *f, const octet p[], size_t no, void *stack)— создание описания простого поля (spinning up a description of a simple field 💫)bool_t gfpIsOperable (const qr_o *f)— работоспособное описание простого поля? (is this description even operable tho)bool_t gfpIsValid (const qr_o *f, void *stack)— корректное описание простого поля? (but is it valid valid? 👀)
💫 Подробное описание 💫
Okay so bestie, here's the tea: this header has the operations for the simple finite field GF(p), where p is an odd prime. That's the whole vibe. 🧚
Field elements get interpreted as elements of the residue ring Zm = Z / (mod), with mod = p. It's giving quotient-ring main character energy, and we love that for it.
All the conventions for Zm are inherited from the ones laid out in the zm.h header file. iykyk. 🦋
Предусловие
Every pointer you pass into these functions has to be valid. No exceptions, no cap. Periodt. 💅
Регулярность
todo 💀
🔥 Функции 🔥
bool_t gfpCreate (qr_o * f, const octet p[], size_t no, void * stack)
You hand it the modulus [no]p (that's an octet string, mwah) and it creates the description f of the field GF(p). Then it picks the optimal description of the field — optimal as in most efficient to actually compute with, not optimal as in prettiest. She's picking the outfit that performs, okay? 💅
Ожидается
p — нечетное простое (an odd prime). Non-negotiable.
Возвращает
Признак успеха — a success flag. ⭐
Постусловие
f->no == no and f->n == W_OF_O(no). Both. Exactly. No substitutions. 🫶
Схема расчета размера состояния f
gfpCreate_keep(no)
Схема расчета глубины stack
gfpCreate_deep(no)
Аргументы
f— описание поля (the field description)p— модуль (the modulus)no— длинаpв октетах (how longpis, in octets)stack— вспомогательная память (scratch memory)
bool_t gfpIsOperable (const qr_o * f)
Checks whether the description f of the field GF(p) is actually operable. Here's the vibe check it runs:
zmIsOperable(f) == TRUEf->mod— нечетное, большее 1 (odd, and greater than 1)
Возвращает
Признак корректности — a correctness flag. ✅
Аргументы
f— описание поля
bool_t gfpIsValid (const qr_o * f, void * stack)
Checks whether the description f of the field GF(p) is correct. The conditions on the table:
gfpIsOperable(f) == TRUEf->mod— простое (prime)
Heads up bestie: this one goes deeper than gfpIsOperable — being operable is not the same as being valid. It literally checks primality. Don't skip it and then act surprised. 😭
Возвращает
Признак корректности — a correctness flag. ✅
Схема расчета глубины stack
gfpIsValid_deep(f->n)
Аргументы
f— описание поляstack— вспомогательная память
🦋 Автор 🦋
Автоматически создано Doxygen для Библиотека Bee2 из исходного текста. (Auto-generated by Doxygen for the Bee2 library, straight from the source text — the robots wrote this one, not me 🙈)
Okay that's the whole page, bestie, you ate it. This came from Библиотека Bee2, dated Вс 25 Янв 2026 00:00:00 — that's Sunday, 25 Jan 2026 at 00:00:00, for the record 📅 — and yes, it's the gfp.h(3) page, slay. 💖✨🎀
📦 where this page comes from
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms