Skip to content

Commit d702c79

Browse files
author
Ludwig
committed
Copyright notice
1 parent 6b63f02 commit d702c79

6 files changed

+111
-5
lines changed

algorithm.c

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
#include <inttypes.h>
1+
/*
2+
Copyright 2020, Ludwig V. <https://github.com/ludwig-v>
3+
Original algorithm by Wouter Bokslag & Jason F. <https://github.com/prototux>
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License at <http://www.gnu.org/licenses/> for
14+
more details.
215
3-
/* Full credit to Wouter Bokslag & Jason F. - https://github.com/prototux - */
16+
The above copyright notice and this permission notice shall be included in
17+
all copies or substantial portions of the Software.
18+
*/
19+
20+
#include <inttypes.h>
421

522
// Transformation function with PSA not-so-secret sauce
623
int16_t transform(uint8_t data_msb, uint8_t data_lsb, uint8_t sec[])

algorithm.ino

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
Copyright 2020, Ludwig V. <https://github.com/ludwig-v>
3+
Original algorithm by Wouter Bokslag & Jason F. <https://github.com/prototux>
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License at <http://www.gnu.org/licenses/> for
14+
more details.
15+
16+
The above copyright notice and this permission notice shall be included in
17+
all copies or substantial portions of the Software.
18+
*/
19+
120
int transform(byte data_msb, byte data_lsb, byte sec[]) {
221
int data = (data_msb << 8) | data_lsb;
322
int result = ((data % sec[0]) * sec[2]) - ((data / sec[0]) * sec[1]);

algorithmOriginalWork.cs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
Copyright 2020, Ludwig V. <https://github.com/ludwig-v>
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License at <http://www.gnu.org/licenses/> for
13+
more details.
14+
15+
The above copyright notice and this permission notice shall be included in
16+
all copies or substantial portions of the Software.
17+
*/
18+
119
using System;
220

321
public class Program

algorithmOriginalWork.php

+18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
<?php
22

3+
/*
4+
Copyright 2020, Ludwig V. <https://github.com/ludwig-v>
5+
6+
This program is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation, either version 3 of the License, or
9+
(at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License at <http://www.gnu.org/licenses/> for
15+
more details.
16+
17+
The above copyright notice and this permission notice shall be included in
18+
all copies or substantial portions of the Software.
19+
*/
20+
321
function getKey($seedTXT, $appKeyTXT = "0000") { // Some hideous code because PHP is not a strongly typed language, this is working on a 64bits machine
422
$seed = str_split($seedTXT, 2);
523
$appKey = str_split($appKeyTXT, 2);

algorithmSimplified.cs

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1+
/*
2+
Copyright 2020, Ludwig V. <https://github.com/ludwig-v>
3+
Original algorithm by Wouter Bokslag & Jason F. <https://github.com/prototux>
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License at <http://www.gnu.org/licenses/> for
14+
more details.
15+
16+
The above copyright notice and this permission notice shall be included in
17+
all copies or substantial portions of the Software.
18+
*/
19+
120
using System;
221

322
public class Program
423
{
5-
/* Simplified version for C# based on Wouter Bokslag & Jason F. - https://github.com/prototux - work */
6-
724
public static Int32 transform(int data, int[] sec) {
825
Int32 result = ((data % sec[0]) * sec[2]) - ((data / sec[0]) * sec[1]);
926
if (result < 0)

algorithmSimplified.php

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
<?php
22

3-
/* Simplified version for PHP based on Wouter Bokslag & Jason F. - https://github.com/prototux - work */
3+
/*
4+
Copyright 2020, Ludwig V. <https://github.com/ludwig-v>
5+
Original algorithm by Wouter Bokslag & Jason F. <https://github.com/prototux>
6+
7+
This program is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation, either version 3 of the License, or
10+
(at your option) any later version.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License at <http://www.gnu.org/licenses/> for
16+
more details.
17+
18+
The above copyright notice and this permission notice shall be included in
19+
all copies or substantial portions of the Software.
20+
*/
421

522
function transform($data, $sec) { // Some hideous code because PHP is not a strongly typed language, this is working on a 64bits machine
623
if ($data > 0x7FFF) {

0 commit comments

Comments
 (0)