/* Copyright (C) 2011-2022 Patrick H. E. Foubet - S.E.R.I.A.N.E. 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 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 *******************************************************************/ /* scs.c */ /* Scs means Sister Chip Signature */ #include #include #include "scs.h" static struct Ref { /* Representatives data */ double D; char C1; char C2; short S; char C3; int I; char C4; long long LL; } E; static uint32_t MyScs=0; static void Scs_init(void) { E.C1 = 'N'; E.C2 = 'i'; E.C3 = 'f'; E.C4 = 'e'; E.D = 2.7182818284590452354; /* e */ E.S = 763; E.I = 33497; E.LL = (long long) 762572642; } uint32_t getScs(void) { int i,l; unsigned char *t, k; uint32_t r; if (MyScs == 0) { Scs_init(); l = sizeof(E); t =(unsigned char*)&E; r=0; k=0; for (i=0; i