forked from pool/liboqs
Accepting request 943477 from home:msmeissn
add lib openquantum safe for factory usage OBS-URL: https://build.opensuse.org/request/show/943477 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/liboqs?expand=0&rev=1
This commit is contained in:
commit
8feaf64ed7
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
3
0.7.1.tar.gz
Normal file
3
0.7.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c8a1ffcfd4facc90916557c0efae9a28c46e803b088d0cb32ee7b0b010555d3a
|
||||
size 8001754
|
2
baselibs.conf
Normal file
2
baselibs.conf
Normal file
@ -0,0 +1,2 @@
|
||||
liboqs0
|
||||
liboqs-devel
|
346
liboqs-fix-build.patch
Normal file
346
liboqs-fix-build.patch
Normal file
@ -0,0 +1,346 @@
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024-90s_ref/kem.h
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber1024-90s_ref/kem.h
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024-90s_ref/kem.h
|
||||
@@ -30,12 +30,13 @@
|
||||
#endif
|
||||
|
||||
#define crypto_kem_keypair KYBER_NAMESPACE(keypair)
|
||||
-int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_enc KYBER_NAMESPACE(enc)
|
||||
-int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES]);
|
||||
|
||||
#define crypto_kem_dec KYBER_NAMESPACE(dec)
|
||||
-int crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
|
||||
#endif
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024_ref/kem.h
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber1024_ref/kem.h
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024_ref/kem.h
|
||||
@@ -30,12 +30,13 @@
|
||||
#endif
|
||||
|
||||
#define crypto_kem_keypair KYBER_NAMESPACE(keypair)
|
||||
-int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_enc KYBER_NAMESPACE(enc)
|
||||
-int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES]);
|
||||
|
||||
#define crypto_kem_dec KYBER_NAMESPACE(dec)
|
||||
-int crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
|
||||
#endif
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512-90s_ref/kem.h
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber512-90s_ref/kem.h
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512-90s_ref/kem.h
|
||||
@@ -30,12 +30,13 @@
|
||||
#endif
|
||||
|
||||
#define crypto_kem_keypair KYBER_NAMESPACE(keypair)
|
||||
-int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_enc KYBER_NAMESPACE(enc)
|
||||
-int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES]);
|
||||
|
||||
#define crypto_kem_dec KYBER_NAMESPACE(dec)
|
||||
-int crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
|
||||
#endif
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512_ref/kem.h
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber512_ref/kem.h
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512_ref/kem.h
|
||||
@@ -30,12 +30,15 @@
|
||||
#endif
|
||||
|
||||
#define crypto_kem_keypair KYBER_NAMESPACE(keypair)
|
||||
-int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_enc KYBER_NAMESPACE(enc)
|
||||
-int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_dec KYBER_NAMESPACE(dec)
|
||||
-int crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
+
|
||||
|
||||
#endif
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768-90s_ref/kem.h
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber768-90s_ref/kem.h
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768-90s_ref/kem.h
|
||||
@@ -30,12 +30,14 @@
|
||||
#endif
|
||||
|
||||
#define crypto_kem_keypair KYBER_NAMESPACE(keypair)
|
||||
-int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_enc KYBER_NAMESPACE(enc)
|
||||
-int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_dec KYBER_NAMESPACE(dec)
|
||||
-int crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
|
||||
#endif
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768_ref/kem.h
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber768_ref/kem.h
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768_ref/kem.h
|
||||
@@ -30,12 +30,14 @@
|
||||
#endif
|
||||
|
||||
#define crypto_kem_keypair KYBER_NAMESPACE(keypair)
|
||||
-int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_enc KYBER_NAMESPACE(enc)
|
||||
-int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES]);
|
||||
+
|
||||
|
||||
#define crypto_kem_dec KYBER_NAMESPACE(dec)
|
||||
-int crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES]);
|
||||
|
||||
#endif
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512_ref/kem.c
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber512_ref/kem.c
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512_ref/kem.c
|
||||
@@ -20,8 +20,7 @@
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_keypair(uint8_t *pk,
|
||||
- uint8_t *sk)
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
indcpa_keypair(pk, sk);
|
||||
@@ -48,9 +47,7 @@ int crypto_kem_keypair(uint8_t *pk,
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_enc(uint8_t *ct,
|
||||
- uint8_t *ss,
|
||||
- const uint8_t *pk)
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES])
|
||||
{
|
||||
uint8_t buf[2*KYBER_SYMBYTES];
|
||||
/* Will contain key, coins */
|
||||
@@ -91,9 +88,7 @@ int crypto_kem_enc(uint8_t *ct,
|
||||
*
|
||||
* On failure, ss will contain a pseudo-random value.
|
||||
**************************************************/
|
||||
-int crypto_kem_dec(uint8_t *ss,
|
||||
- const uint8_t *ct,
|
||||
- const uint8_t *sk)
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
int fail;
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768_ref/kem.c
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber768_ref/kem.c
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768_ref/kem.c
|
||||
@@ -20,8 +20,7 @@
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_keypair(uint8_t *pk,
|
||||
- uint8_t *sk)
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
indcpa_keypair(pk, sk);
|
||||
@@ -48,9 +47,7 @@ int crypto_kem_keypair(uint8_t *pk,
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_enc(uint8_t *ct,
|
||||
- uint8_t *ss,
|
||||
- const uint8_t *pk)
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES])
|
||||
{
|
||||
uint8_t buf[2*KYBER_SYMBYTES];
|
||||
/* Will contain key, coins */
|
||||
@@ -91,9 +88,7 @@ int crypto_kem_enc(uint8_t *ct,
|
||||
*
|
||||
* On failure, ss will contain a pseudo-random value.
|
||||
**************************************************/
|
||||
-int crypto_kem_dec(uint8_t *ss,
|
||||
- const uint8_t *ct,
|
||||
- const uint8_t *sk)
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
int fail;
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024_ref/kem.c
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber1024_ref/kem.c
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024_ref/kem.c
|
||||
@@ -20,8 +20,7 @@
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_keypair(uint8_t *pk,
|
||||
- uint8_t *sk)
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
indcpa_keypair(pk, sk);
|
||||
@@ -48,9 +47,7 @@ int crypto_kem_keypair(uint8_t *pk,
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_enc(uint8_t *ct,
|
||||
- uint8_t *ss,
|
||||
- const uint8_t *pk)
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES])
|
||||
{
|
||||
uint8_t buf[2*KYBER_SYMBYTES];
|
||||
/* Will contain key, coins */
|
||||
@@ -91,9 +88,7 @@ int crypto_kem_enc(uint8_t *ct,
|
||||
*
|
||||
* On failure, ss will contain a pseudo-random value.
|
||||
**************************************************/
|
||||
-int crypto_kem_dec(uint8_t *ss,
|
||||
- const uint8_t *ct,
|
||||
- const uint8_t *sk)
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
int fail;
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768-90s_ref/kem.c
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber768-90s_ref/kem.c
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber768-90s_ref/kem.c
|
||||
@@ -20,8 +20,7 @@
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_keypair(uint8_t *pk,
|
||||
- uint8_t *sk)
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
indcpa_keypair(pk, sk);
|
||||
@@ -48,9 +47,7 @@ int crypto_kem_keypair(uint8_t *pk,
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_enc(uint8_t *ct,
|
||||
- uint8_t *ss,
|
||||
- const uint8_t *pk)
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES])
|
||||
{
|
||||
uint8_t buf[2*KYBER_SYMBYTES];
|
||||
/* Will contain key, coins */
|
||||
@@ -91,9 +88,7 @@ int crypto_kem_enc(uint8_t *ct,
|
||||
*
|
||||
* On failure, ss will contain a pseudo-random value.
|
||||
**************************************************/
|
||||
-int crypto_kem_dec(uint8_t *ss,
|
||||
- const uint8_t *ct,
|
||||
- const uint8_t *sk)
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
int fail;
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512-90s_ref/kem.c
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber512-90s_ref/kem.c
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber512-90s_ref/kem.c
|
||||
@@ -20,8 +20,7 @@
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_keypair(uint8_t *pk,
|
||||
- uint8_t *sk)
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
indcpa_keypair(pk, sk);
|
||||
@@ -48,9 +47,7 @@ int crypto_kem_keypair(uint8_t *pk,
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_enc(uint8_t *ct,
|
||||
- uint8_t *ss,
|
||||
- const uint8_t *pk)
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES])
|
||||
{
|
||||
uint8_t buf[2*KYBER_SYMBYTES];
|
||||
/* Will contain key, coins */
|
||||
@@ -91,9 +88,7 @@ int crypto_kem_enc(uint8_t *ct,
|
||||
*
|
||||
* On failure, ss will contain a pseudo-random value.
|
||||
**************************************************/
|
||||
-int crypto_kem_dec(uint8_t *ss,
|
||||
- const uint8_t *ct,
|
||||
- const uint8_t *sk)
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
int fail;
|
||||
Index: liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024-90s_ref/kem.c
|
||||
===================================================================
|
||||
--- liboqs-0.7.1.orig/src/kem/kyber/pqcrystals-kyber_kyber1024-90s_ref/kem.c
|
||||
+++ liboqs-0.7.1/src/kem/kyber/pqcrystals-kyber_kyber1024-90s_ref/kem.c
|
||||
@@ -20,8 +20,7 @@
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_keypair(uint8_t *pk,
|
||||
- uint8_t *sk)
|
||||
+int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES], uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
indcpa_keypair(pk, sk);
|
||||
@@ -48,9 +47,7 @@ int crypto_kem_keypair(uint8_t *pk,
|
||||
*
|
||||
* Returns 0 (success)
|
||||
**************************************************/
|
||||
-int crypto_kem_enc(uint8_t *ct,
|
||||
- uint8_t *ss,
|
||||
- const uint8_t *pk)
|
||||
+int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES], uint8_t ss[KYBER_SSBYTES], const uint8_t pk[KYBER_PUBLICKEYBYTES])
|
||||
{
|
||||
uint8_t buf[2*KYBER_SYMBYTES];
|
||||
/* Will contain key, coins */
|
||||
@@ -91,9 +88,7 @@ int crypto_kem_enc(uint8_t *ct,
|
||||
*
|
||||
* On failure, ss will contain a pseudo-random value.
|
||||
**************************************************/
|
||||
-int crypto_kem_dec(uint8_t *ss,
|
||||
- const uint8_t *ct,
|
||||
- const uint8_t *sk)
|
||||
+int crypto_kem_dec(uint8_t ss[KYBER_SSBYTES], const uint8_t ct[KYBER_CIPHERTEXTBYTES], const uint8_t sk[KYBER_SECRETKEYBYTES])
|
||||
{
|
||||
size_t i;
|
||||
int fail;
|
4
liboqs.changes
Normal file
4
liboqs.changes
Normal file
@ -0,0 +1,4 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 12 13:08:09 UTC 2021 - Marcus Meissner <meissner@suse.com>
|
||||
|
||||
- initial import of the liboqs Open Quantum Safe library, version 0.7.1
|
101
liboqs.spec
Normal file
101
liboqs.spec
Normal file
@ -0,0 +1,101 @@
|
||||
#
|
||||
# spec file for package libkcapi
|
||||
#
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: liboqs
|
||||
Version: 0.7.1
|
||||
Release: 0
|
||||
Summary: Open source C library for quantum-resistant cryptographic algorithms
|
||||
License: MIT
|
||||
Group: Productivity/Security
|
||||
Url: https://github.com/open-quantum-safe/liboqs/
|
||||
Source: https://github.com/open-quantum-safe/liboqs/archive/refs/tags/%{version}.tar.gz
|
||||
Source1: baselibs.conf
|
||||
Patch0: liboqs-fix-build.patch
|
||||
BuildRequires: cmake
|
||||
BuildRequires: libopenssl-devel
|
||||
BuildRequires: doxygen
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
liboqs is an open source C library for quantum-resistant cryptographic
|
||||
algorithms. Details about liboqs can be found in README.md. See in
|
||||
particular limitations on intended use.
|
||||
|
||||
%package -n liboqs0
|
||||
Summary: Open source C library for quantum-resistant cryptographic algorithms
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n liboqs0
|
||||
liboqs is an open source C library for quantum-resistant cryptographic
|
||||
algorithms. Details about liboqs can be found in README.md. See in
|
||||
particular limitations on intended use.
|
||||
|
||||
%package devel
|
||||
Summary: Open source C library for quantum-resistant cryptographic algorithms
|
||||
Group: Development/Languages/C and C++
|
||||
Requires: liboqs0 = %version
|
||||
|
||||
%description devel
|
||||
liboqs is an open source C library for quantum-resistant cryptographic
|
||||
algorithms. Details about liboqs can be found in README.md. See in
|
||||
particular limitations on intended use.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
mkdir build
|
||||
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -std=gnu11"
|
||||
cd build
|
||||
cmake -DBUILD_SHARED_LIBS=ON ..
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
# need to find out what cmake option is needed
|
||||
mv %buildroot/usr/local/* %buildroot/usr
|
||||
if [ "%_lib" != "lib" ]; then
|
||||
mv %buildroot/usr/lib %buildroot/usr/%_lib
|
||||
fi
|
||||
rmdir %buildroot/usr/local/
|
||||
|
||||
%post -n liboqs0 -p /sbin/ldconfig
|
||||
|
||||
|
||||
%postun -n liboqs0 -p /sbin/ldconfig
|
||||
|
||||
%files -n liboqs0
|
||||
%defattr(-,root,root)
|
||||
%license LICENSE.txt
|
||||
/%{_libdir}/liboqs.so.0*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%license LICENSE.txt
|
||||
%dir %{_includedir}/oqs
|
||||
%{_includedir}/oqs/*
|
||||
/%_libdir/liboqs.so
|
||||
%dir /%_libdir/cmake/
|
||||
%dir /%_libdir/cmake/liboqs/
|
||||
/%_libdir/cmake/liboqs/liboqsConfig-noconfig.cmake
|
||||
/%_libdir/cmake/liboqs/liboqsConfig.cmake
|
||||
|
||||
|
||||
%changelog
|
Loading…
x
Reference in New Issue
Block a user