GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Simple-Homomorphic-Encryption/utilities.c at master · obserthinker/Simple-Homomorphic-Encryption

Expand file tree

/

utilities.c

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
30 lines (25 loc) · 631 Bytes
/

utilities.c

Copy path

File metadata and controls

30 lines (25 loc) · 631 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "utilities.h"
void mpz_correct_mod(mpz_t result, mpz_t n, mpz_t d) {
mpz_tdiv_r(result, n, d);
mpz_t temp;
mpz_init(temp);
mpz_fdiv_q_2exp(temp, d, 1);
if (mpz_cmp(result, temp) > 0) {
mpz_sub(result, d, result);
}
mpz_clear(temp);
}
unsigned long int max(unsigned long int a, unsigned long int b) {
return (a > b) ? a : b;
}
void textcolor(int attr, int fg) {
//char command[13];
/* Command is the control command to the terminal */
if (COLOR_OUTPUT)
printf("%c[%d;%dm", 0x1B, attr, fg + 30);
//printf("%s", command);
}
void resettextcolor() {
if (COLOR_OUTPUT)
printf("%c[0m", 0x1B);
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.