Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lwc
/
candidates
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a8513304
authored
Oct 09, 2020
by
Sebastian Renner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing decrypt.c file for ISAP (provided by Robert Primas)
parent
bd5da236
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
390 additions
and
0 deletions
+390
-0
isap/Implementations/crypto_aead/isapa128av20/opt_32/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapa128av20/opt_32_armv67m/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapa128av20/opt_64/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapa128v20/opt_32/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapa128v20/opt_32_armv67m/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapa128v20/opt_64/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapk128av20/opt_32_armv6m/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapk128av20/opt_32_armv7m/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapk128v20/opt_32_armv6m/decrypt.c
+39
-0
isap/Implementations/crypto_aead/isapk128v20/opt_32_armv7m/decrypt.c
+39
-0
No files found.
isap/Implementations/crypto_aead/isapa128av20/opt_32/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapa128av20/opt_32_armv67m/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapa128av20/opt_64/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapa128v20/opt_32/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapa128v20/opt_32_armv67m/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapa128v20/opt_64/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapk128av20/opt_32_armv6m/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapk128av20/opt_32_armv7m/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapk128v20/opt_32_armv6m/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
isap/Implementations/crypto_aead/isapk128v20/opt_32_armv7m/decrypt.c
0 → 100644
View file @
a8513304
#include <stdio.h>
#include <string.h>
#include "api.h"
#include "isap.h"
int
crypto_aead_decrypt
(
unsigned
char
*
m
,
unsigned
long
long
*
mlen
,
unsigned
char
*
nsec
,
const
unsigned
char
*
c
,
unsigned
long
long
clen
,
const
unsigned
char
*
ad
,
unsigned
long
long
adlen
,
const
unsigned
char
*
npub
,
const
unsigned
char
*
k
){
(
void
)
nsec
;
// Plaintext length is clen - tag length
*
mlen
=
clen
-
ISAP_TAG_SZ
;
// Generate tag
unsigned
char
tag
[
ISAP_TAG_SZ
];
isap_mac
(
k
,
npub
,
ad
,
adlen
,
c
,
*
mlen
,
tag
);
// Compare tag
unsigned
long
eq_cnt
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ISAP_TAG_SZ
;
i
++
)
{
eq_cnt
+=
(
tag
[
i
]
==
c
[(
*
mlen
)
+
i
]);
}
// Perform decryption if tag is correct
if
(
eq_cnt
==
(
unsigned
long
)
ISAP_TAG_SZ
){
if
(
*
mlen
>
0
)
{
isap_enc
(
k
,
npub
,
c
,
*
mlen
,
m
);
}
return
0
;
}
else
{
return
-
1
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment