Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
sidh: updates algorithm to SIDHv3 and refactoring (#6) * tests: adds continues integration * Makefile has targets for running tests, benchmarks and code coverage. It also contains target for env preparation. In order to run sidh tests GOPATH must contain p751toolbox package. I've chosen to manualy copy this package to the temporary GOPATH directory. It could also be done by calling "go get", but then any commit to both p751toolbox and sidh would need to be done in 2 steps. * .travis.yml calls make and uploads code coverage to Codecov * move sidh to seperated folder * sidh: updates algorithm to SIDHv3 and refactoring * makes an algorithm compatible with Microsoft's SIDHv3 implementation. This is required to implement SIKE key encapsulation mechanism, as specified in PQC NIST submission from Nov, 30 2017 * removes SIDHBobPublicKey/SIDHAlicePublicKey/SIDHBobPrivateKey/ SIDHAlicePrivateKey. Instead PrivateKey and PublicKey structures where introduced. Each of this structure stores variant of a key A or B. Implementation uses a key variant in order to differentiate between 2- and 3-torision groups. Main goal of removing "Alice" and "Bob" specific structures is to remove code duplication * Introduces SidhParams: structure to store prime field and SIDH domain parameters. * Refactors public API. Introduces: - Functions to generate, import, export keypair - DeriveSecret function to create shared secret - Supporting functions and types * Removes code which is not used by implementation anymore, like DistortAndDifference(), SecretPoint(), DblAdd(), OkeyaSakuraiCoordinateRecovery() and many more. Also tests for those functions are removed. * Adds fixes for key import/export
il y a 6 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. package sidh
  2. import (
  3. "bytes"
  4. "crypto/rand"
  5. "encoding/hex"
  6. "fmt"
  7. "math/big"
  8. "testing"
  9. . "github.com/cloudflare/sidh/internal/isogeny"
  10. )
  11. /* -------------------------------------------------------------------------
  12. Test data
  13. -------------------------------------------------------------------------*/
  14. var tdata = map[uint8]struct {
  15. name string
  16. PkA string
  17. PrA string
  18. PkB string
  19. PrB string
  20. }{
  21. FP_503: {
  22. name: "P-503",
  23. PrA: "B0AD510708F4ABCF3E0D97DC2F2FF112D9D2AAE49D97FFD1E4267F21C6E71C03",
  24. PrB: "A885A8B889520A6DBAD9FB33365E5B77FDED629440A16A533F259A510F63A822",
  25. PkA: "A6BADBA04518A924B20046B59AC197DCDF0EA48014C9E228C4994CCA432F360E" +
  26. "2D527AFB06CA7C96EE5CEE19BAD53BF9218A3961CAD7EC092BD8D9EBB22A3D51" +
  27. "33008895A3F1F6A023F91E0FE06A00A622FD6335DAC107F8EC4283DC2632F080" +
  28. "4E64B390DAD8A2572F1947C67FDF4F8787D140CE2C6B24E752DA9A195040EDFA" +
  29. "C27333FAE97DBDEB41DA9EEB2DB067AE7DA8C58C0EF57AEFC18A3D6BD0576FF2" +
  30. "F1CFCAEC50C958331BF631F3D2E769790C7B6DF282B74BBC02998AD10F291D47" +
  31. "C5A762FF84253D3B3278BDF20C8D4D4AA317BE401B884E26A1F02C7308AADB68" +
  32. "20EBDB0D339F5A63346F3B40CACED72F544DAF51566C6E807D0E6E1E38514342" +
  33. "432661DC9564DA07548570E256688CD9E8060D8775F95D501886D958588CACA0" +
  34. "9F2D2AE1913F996E76AF63E31A179A7A7D2A46EDA03B2BCCF9020A5AA15F9A28" +
  35. "9340B33F3AE7F97360D45F8AE1B9DD48779A57E8C45B50A02C00349CD1C58C55" +
  36. "1D68BC2A75EAFED944E8C599C288037181E997471352E24C952B",
  37. PkB: "244AF1F367C2C33912750A98497CC8214BC195BD52BD76513D32ACE4B75E31F0" +
  38. "281755C265F5565C74E3C04182B9C244071859C8588CC7F09547CEFF8F7705D2" +
  39. "60CE87D6BFF914EE7DBE4B9AF051CA420062EEBDF043AF58184495026949B068" +
  40. "98A47046BFAE8DF3B447746184AF550553BB5D266D6E1967ACA33CAC5F399F90" +
  41. "360D70867F2C71EF6F94FF915C7DA8BC9549FB7656E691DAEFC93CF56876E482" +
  42. "CA2F8BE2D6CDCC374C31AD8833CABE997CC92305F38497BEC4DFD1821B004FEC" +
  43. "E16448F9A24F965EFE409A8939EEA671633D9FFCF961283E59B8834BDF7EDDB3" +
  44. "05D6275B61DA6692325432A0BAA074FC7C1F51E76208AB193A57520D40A76334" +
  45. "EE5712BDC3E1EFB6103966F2329EDFF63082C4DFCDF6BE1C5A048630B81871B8" +
  46. "83B735748A8FD4E2D9530C272163AB18105B10015CA7456202FE1C9B92CEB167" +
  47. "5EAE1132E582C88E47ED87B363D45F05BEA714D5E9933D7AF4071CBB5D49008F" +
  48. "3E3DAD7DFF935EE509D5DE561842B678CCEB133D62E270E9AC3E",
  49. },
  50. FP_751: {
  51. name: "P-751",
  52. // PrA - Alice's Private Key: 2*randint(0,2^371)
  53. PrA: "C09957CC83045FB4C3726384D784476ACB6FFD92E5B15B3C2D451BA063F1BD4CED8FBCF682A98DD0954D3" +
  54. "7BCAF730E",
  55. // PrB - Bob's Private Key: 3*randint(0,3^238)
  56. PrB: "393E8510E78A16D2DC1AACA9C9D17E7E78DB630881D8599C7040D05BB5557ECAE8165C45D5366ECB37B00" +
  57. "969740AF201",
  58. PkA: "74D8EF08CB74EC99BF08B6FBE4FB3D048873B67F018E44988B9D70C564D058401D20E093C7DF0C66F022C" +
  59. "823E5139D2EA0EE137804B4820E950B046A90B0597759A0B6A197C56270128EA089FA1A2007DDE3430B37" +
  60. "A3E6350BD47B7F513863741C125FA63DEDAFC475C13DB59E533055B7CBE4B2F32672DF2DF97E03E29617B" +
  61. "0E9B6A35B58ABB26527A721142701EB147C7050E1D9125DA577B08CD51C8BB50627B8B47FACFC9C7C07DD" +
  62. "00DD75115DD83719FD5F96115DED23ECAA50B1044C6BF3F27442DA284BA4A272D850F414FB185801BF2EF" +
  63. "7E628EDB5643E35694B992CF30A2C5120CAF9434F09ACFCA3645B3FFC3A308901FAC7B8955FD5C98576AE" +
  64. "FD03F5806CB7430F75B3431B75BEC080596ABCA26E637E6E8D4C25175A8C052C9CBE77900A863F83FAB00" +
  65. "95B32D9C3858EF8A35B9F163D429E71DBA47539EB4791D117FE39DDE94EA7801A42DB12D84DE4740ACF51" +
  66. "CD7C32BB854569D7D94E11E69D9663CC7ED02E78CF48F4069DF3D3E86198B307095C6B11D46C0DC849F9D" +
  67. "94C7693209E5B3848AFAA6DA6A8D73362D779CBC43515902ED2BCE3A748C537DE2FCF092FD3E91B790AF5" +
  68. "4E1092C5E5B89BE5BE23B955A52F769D97277EF69F820109042F28C316AC90AE69EB374C9280300B816E6" +
  69. "2494B2E01072D1CA96E4B284D2BE1368D6969744B614FACBC8C165864E26E33481D4FDC47B6E523954A25" +
  70. "C1A096A37CD23FB81AE64FB11BD0A439609F1CE40673B06DD96F698A910E935219D840F3D411EDFB00D98" +
  71. "065AB9868C32D3DA05FF415",
  72. PkB: "F6C260C4141E418457CB442E11F0F5558375437576E55D211D19EF83E2839E51D07A82765D8E7B6366FA7" +
  73. "0B56CDE3AD3B629ACF542A433369496EDA51EDFBE16EFA1B8DEE1CE46B37820ECBD0CD674AACD4F21FABC" +
  74. "2436651E3AF604356FF3EB2CA87976890E34A56FAEC9A2ACD9559B1BB67B69AC1A521342E1E787DA5D709" +
  75. "32B0F5842ECA1C99B269DB6C2ED8397F0FC49F114CF8B5AF327A698C0251575CDD1D67732668109A91A3B" +
  76. "FA5B47D413C7FAB8817FCBEBFE9BDD9C0B1F3B1934A7028A65233E8B58A92E7E9F66B68B2057ECBF7E44A" +
  77. "0EF6EFCC3C8AA5414E100FA0C24F7545324AD17062FC11377A2A4749DEE27E192460E099DBDA8E840EA11" +
  78. "AD9D5C83DF065AF77030E7FE18CE24CFC71D356B9B9601811B93676C12CB6B41747133D5259E7A20CC065" +
  79. "FAB99DF944FDB34ABB9A374F9E9CC8F9C186BD2181DC2771F69C02629C3E4801A7E7C21F6F3CFF7D257E2" +
  80. "257C88C015F0CC8DC0E7FB3373CF4ED6A786AB329E7F16895CA147AD91F6EAE1DFE38116580DF52381599" +
  81. "E4246278CB1848FE4A56ABF98652E9E7C2E681551A3D78FA033D932087D8B6567D779A56B726B153033D7" +
  82. "2231A1B5C16ED7DC4458308D6B64AF6723CC0F52C94E04C58FCA9739E890AA40CC05E22321F10129D2B59" +
  83. "1F317102034C109A56D711591E5B44C717CFC9C9B9461894767CAFA42D2B394194B03999C2A9EF48868F3" +
  84. "FB03D1A40F596613AF97F4ED7643A1C2D12692E959C6DEB8E72403ADC0E42204DBCE5056EEF0CC60B0C6E" +
  85. "83B8B55AC01F6C85644EE49",
  86. },
  87. }
  88. /* -------------------------------------------------------------------------
  89. Helpers
  90. -------------------------------------------------------------------------*/
  91. // Fail if err !=nil. Display msg as an error message
  92. func checkErr(t testing.TB, err error, msg string) {
  93. if err != nil {
  94. t.Error(msg)
  95. }
  96. }
  97. // Utility used for running same test with all registered prime fields
  98. type MultiIdTestingFunc func(testing.TB, uint8)
  99. func Do(f MultiIdTestingFunc, t testing.TB) {
  100. for id, val := range tdata {
  101. fmt.Printf("\tTesting: %s\n", val.name)
  102. f(t, id)
  103. }
  104. }
  105. // Converts string to private key
  106. func convToPrv(s string, v KeyVariant, id uint8) *PrivateKey {
  107. key := NewPrivateKey(id, v)
  108. hex, e := hex.DecodeString(s)
  109. if e != nil {
  110. panic("non-hex number provided")
  111. }
  112. e = key.Import(hex)
  113. if e != nil {
  114. panic("Can't import private key")
  115. }
  116. return key
  117. }
  118. // Converts string to public key
  119. func convToPub(s string, v KeyVariant, id uint8) *PublicKey {
  120. key := NewPublicKey(id, v)
  121. hex, e := hex.DecodeString(s)
  122. if e != nil {
  123. panic("non-hex number provided")
  124. }
  125. e = key.Import(hex)
  126. if e != nil {
  127. panic("Can't import public key")
  128. }
  129. return key
  130. }
  131. /* -------------------------------------------------------------------------
  132. Unit tests
  133. -------------------------------------------------------------------------*/
  134. func testKeygen(t testing.TB, id uint8) {
  135. alicePrivate := convToPrv(tdata[id].PrA, KeyVariant_SIDH_A, id)
  136. bobPrivate := convToPrv(tdata[id].PrB, KeyVariant_SIDH_B, id)
  137. expPubA := convToPub(tdata[id].PkA, KeyVariant_SIDH_A, id)
  138. expPubB := convToPub(tdata[id].PkB, KeyVariant_SIDH_B, id)
  139. pubA := alicePrivate.GeneratePublicKey()
  140. pubB := bobPrivate.GeneratePublicKey()
  141. if !bytes.Equal(pubA.Export(), expPubA.Export()) {
  142. t.Fatalf("unexpected value of public key A")
  143. }
  144. if !bytes.Equal(pubB.Export(), expPubB.Export()) {
  145. t.Fatalf("unexpected value of public key B")
  146. }
  147. }
  148. func testRoundtrip(t testing.TB, id uint8) {
  149. var err error
  150. prvA := NewPrivateKey(id, KeyVariant_SIDH_A)
  151. prvB := NewPrivateKey(id, KeyVariant_SIDH_B)
  152. // Generate private keys
  153. err = prvA.Generate(rand.Reader)
  154. checkErr(t, err, "key generation failed")
  155. err = prvB.Generate(rand.Reader)
  156. checkErr(t, err, "key generation failed")
  157. // Generate public keys
  158. pubA := prvA.GeneratePublicKey()
  159. pubB := prvB.GeneratePublicKey()
  160. // Derive shared secret
  161. s1, err := DeriveSecret(prvB, pubA)
  162. checkErr(t, err, "")
  163. s2, err := DeriveSecret(prvA, pubB)
  164. checkErr(t, err, "")
  165. if !bytes.Equal(s1[:], s2[:]) {
  166. t.Fatalf("Tthe two shared keys: \n%X, \n%X do not match", s1, s2)
  167. }
  168. }
  169. func testKeyAgreement(t testing.TB, id uint8, pkA, prA, pkB, prB string) {
  170. var e error
  171. // KeyPairs
  172. alicePublic := convToPub(pkA, KeyVariant_SIDH_A, id)
  173. bobPublic := convToPub(pkB, KeyVariant_SIDH_B, id)
  174. alicePrivate := convToPrv(prA, KeyVariant_SIDH_A, id)
  175. bobPrivate := convToPrv(prB, KeyVariant_SIDH_B, id)
  176. // Do actual test
  177. s1, e := DeriveSecret(bobPrivate, alicePublic)
  178. checkErr(t, e, "derivation s1")
  179. s2, e := DeriveSecret(alicePrivate, bobPublic)
  180. checkErr(t, e, "derivation s1")
  181. if !bytes.Equal(s1[:], s2[:]) {
  182. t.Fatalf("two shared keys: %d, %d do not match", s1, s2)
  183. }
  184. // Negative case
  185. dec, e := hex.DecodeString(tdata[id].PkA)
  186. if e != nil {
  187. t.FailNow()
  188. }
  189. dec[0] = ^dec[0]
  190. e = alicePublic.Import(dec)
  191. if e != nil {
  192. t.FailNow()
  193. }
  194. s1, e = DeriveSecret(bobPrivate, alicePublic)
  195. checkErr(t, e, "derivation of s1 failed")
  196. s2, e = DeriveSecret(alicePrivate, bobPublic)
  197. checkErr(t, e, "derivation of s2 failed")
  198. if bytes.Equal(s1[:], s2[:]) {
  199. t.Fatalf("The two shared keys: %d, %d match", s1, s2)
  200. }
  201. }
  202. func testImportExport(t testing.TB, id uint8) {
  203. var err error
  204. a := NewPublicKey(id, KeyVariant_SIDH_A)
  205. b := NewPublicKey(id, KeyVariant_SIDH_B)
  206. // Import keys
  207. a_hex, err := hex.DecodeString(tdata[id].PkA)
  208. checkErr(t, err, "invalid hex-number provided")
  209. err = a.Import(a_hex)
  210. checkErr(t, err, "import failed")
  211. b_hex, err := hex.DecodeString(tdata[id].PkB)
  212. checkErr(t, err, "invalid hex-number provided")
  213. err = b.Import(b_hex)
  214. checkErr(t, err, "import failed")
  215. // Export and check if same
  216. if !bytes.Equal(b.Export(), b_hex) || !bytes.Equal(a.Export(), a_hex) {
  217. t.Fatalf("export/import failed")
  218. }
  219. if (len(b.Export()) != b.Size()) || (len(a.Export()) != a.Size()) {
  220. t.Fatalf("wrong size of exported keys")
  221. }
  222. }
  223. func testPrivateKeyBelowMax(t testing.TB, id uint8) {
  224. params := Params(id)
  225. for variant, keySz := range map[KeyVariant]*DomainParams{
  226. KeyVariant_SIDH_A: &params.A,
  227. KeyVariant_SIDH_B: &params.B} {
  228. func(v KeyVariant, dp *DomainParams) {
  229. var blen = int(dp.SecretByteLen)
  230. var prv = NewPrivateKey(id, v)
  231. // Calculate either (2^e2 - 1) or (2^s - 1); where s=ceil(log_2(3^e3)))
  232. maxSecertVal := big.NewInt(int64(dp.SecretBitLen))
  233. maxSecertVal.Exp(big.NewInt(int64(2)), maxSecertVal, nil)
  234. maxSecertVal.Sub(maxSecertVal, big.NewInt(1))
  235. // Do same test 1000 times
  236. for i := 0; i < 1000; i++ {
  237. err := prv.Generate(rand.Reader)
  238. checkErr(t, err, "Private key generation")
  239. // Convert to big-endian, as that's what expected by (*Int)SetBytes()
  240. secretBytes := prv.Export()
  241. for i := 0; i < int(blen/2); i++ {
  242. tmp := secretBytes[i] ^ secretBytes[blen-i-1]
  243. secretBytes[i] = tmp ^ secretBytes[i]
  244. secretBytes[blen-i-1] = tmp ^ secretBytes[blen-i-1]
  245. }
  246. prvBig := new(big.Int).SetBytes(secretBytes)
  247. // Check if generated key is bigger then acceptable
  248. if prvBig.Cmp(maxSecertVal) == 1 {
  249. t.Error("Generated private key is wrong")
  250. }
  251. }
  252. }(variant, keySz)
  253. }
  254. }
  255. func TestKeyAgreement(t *testing.T) {
  256. for id, val := range tdata {
  257. fmt.Printf("\tTesting: %s\n", val.name)
  258. testKeyAgreement(t, id, tdata[id].PkA, tdata[id].PrA, tdata[id].PkB, tdata[id].PrB)
  259. }
  260. }
  261. func TestKeyAgreementP751_AliceEvenNumber(t *testing.T) {
  262. // even alice
  263. prE := "C09957CC83045FB4C3726384D784476ACB6FFD92E5B15B3C2D451BA063F1BD4CED8FBCF682A98DD0954D37BCAF730F"
  264. pkE := "8A2DE6FD963C475F7829B689C8B8306FC0917A39EBBC35CA171546269A85698FEC0379E2E1A3C567BE1B8EF5639F81F304889737E6CC444DBED4579DB204DC8C7928F5CBB1ECDD682A1B5C48C0DAF34208C06BF201BE4E6063B1BFDC42413B0537F8E76BEE645C1A24118301BAB17EB8D6E0F283BCB16EFB833E4BB3463953C93165A0DDAC55B385059F27FF7228486D0A733812C81C792BE9EC3A16A5DB0EB099EEA76AC0E59612251A3AD19F7CC567DA2AEBD7733171F48E471D17648692355164E27B515D2A47D7BA34B3B48A047BE7C09C4ABEE2FCC9ACA7396C8A8C9E73E29533FC7369094DFA7988778E55E53F309922C6E233F8F9C7936C3D29CEA640406FCA06450AA1978FF39F227BF06B1E072F1763447C6F513B23CDF3B0EC0379070AEE5A02D9AD8E0EB023461D631F4A9643A4C79921334945F6B33DDFC11D9703BD06B047B4DA404AB12EFD2C3A49E5C42D10DA063352748B21DE41C32A5693FE1C0DCAB111F4990CD58BECADB1892EE7A7E99C9DB4DA4E69C96E57138B99038BC9B877ECE75914EFB98DD08B9E4A2DCCB948A8F7D2F26678A9952BA0EFAB1E9CF6E51B557480DEC2BA30DE0FE4AFE30A6B30765EE75EF64F678316D81C72755AD2CFA0B8C7706B07BFA52FBC3DB84EF9E79796C0089305B1E13C78660779E0FF2A13820CE141104F976B1678990F85B2D3D2B89CD5BC4DD52603A5D24D3EFEDA44BAA0F38CDB75A220AF45EAB70F2799875D435CE50FC6315EDD4BB7AA7260AFD7CD0561B69B4FA3A817904322661C3108DA24"
  265. testKeyAgreement(t, FP_751, pkE, prE, tdata[FP_751].PkB, tdata[FP_751].PrB)
  266. }
  267. /* -------------------------------------------------------------------------
  268. Wrappers for 'testing' module
  269. -------------------------------------------------------------------------*/
  270. func TestKeygen(t *testing.T) { Do(testKeygen, t) }
  271. func TestRoundtrip(t *testing.T) { Do(testRoundtrip, t) }
  272. func TestImportExport(t *testing.T) { Do(testImportExport, t) }
  273. /* -------------------------------------------------------------------------
  274. Benchmarking
  275. -------------------------------------------------------------------------*/
  276. func BenchmarkSidhKeyAgreementP751(b *testing.B) {
  277. // KeyPairs
  278. alicePublic := convToPub(tdata[FP_751].PkA, KeyVariant_SIDH_A, FP_751)
  279. bobPublic := convToPub(tdata[FP_751].PkB, KeyVariant_SIDH_B, FP_751)
  280. alicePrivate := convToPrv(tdata[FP_751].PrA, KeyVariant_SIDH_A, FP_751)
  281. bobPrivate := convToPrv(tdata[FP_751].PrB, KeyVariant_SIDH_B, FP_751)
  282. for i := 0; i < b.N; i++ {
  283. // Derive shared secret
  284. DeriveSecret(bobPrivate, alicePublic)
  285. DeriveSecret(alicePrivate, bobPublic)
  286. }
  287. }
  288. func BenchmarkSidhKeyAgreementP503(b *testing.B) {
  289. // KeyPairs
  290. alicePublic := convToPub(tdata[FP_503].PkA, KeyVariant_SIDH_A, FP_503)
  291. bobPublic := convToPub(tdata[FP_503].PkB, KeyVariant_SIDH_B, FP_503)
  292. alicePrivate := convToPrv(tdata[FP_503].PrA, KeyVariant_SIDH_A, FP_503)
  293. bobPrivate := convToPrv(tdata[FP_503].PrB, KeyVariant_SIDH_B, FP_503)
  294. for i := 0; i < b.N; i++ {
  295. // Derive shared secret
  296. DeriveSecret(bobPrivate, alicePublic)
  297. DeriveSecret(alicePrivate, bobPublic)
  298. }
  299. }
  300. func BenchmarkAliceKeyGenPrvP751(b *testing.B) {
  301. prv := NewPrivateKey(FP_751, KeyVariant_SIDH_A)
  302. for n := 0; n < b.N; n++ {
  303. prv.Generate(rand.Reader)
  304. }
  305. }
  306. func BenchmarkAliceKeyGenPrvP503(b *testing.B) {
  307. prv := NewPrivateKey(FP_503, KeyVariant_SIDH_A)
  308. for n := 0; n < b.N; n++ {
  309. prv.Generate(rand.Reader)
  310. }
  311. }
  312. func BenchmarkBobKeyGenPrvP751(b *testing.B) {
  313. prv := NewPrivateKey(FP_751, KeyVariant_SIDH_B)
  314. for n := 0; n < b.N; n++ {
  315. prv.Generate(rand.Reader)
  316. }
  317. }
  318. func BenchmarkBobKeyGenPrvP503(b *testing.B) {
  319. prv := NewPrivateKey(FP_503, KeyVariant_SIDH_B)
  320. for n := 0; n < b.N; n++ {
  321. prv.Generate(rand.Reader)
  322. }
  323. }
  324. func BenchmarkAliceKeyGenPubP751(b *testing.B) {
  325. prv := NewPrivateKey(FP_751, KeyVariant_SIDH_A)
  326. prv.Generate(rand.Reader)
  327. for n := 0; n < b.N; n++ {
  328. prv.GeneratePublicKey()
  329. }
  330. }
  331. func BenchmarkAliceKeyGenPubP503(b *testing.B) {
  332. prv := NewPrivateKey(FP_503, KeyVariant_SIDH_A)
  333. prv.Generate(rand.Reader)
  334. for n := 0; n < b.N; n++ {
  335. prv.GeneratePublicKey()
  336. }
  337. }
  338. func BenchmarkBobKeyGenPubP751(b *testing.B) {
  339. prv := NewPrivateKey(FP_751, KeyVariant_SIDH_B)
  340. prv.Generate(rand.Reader)
  341. for n := 0; n < b.N; n++ {
  342. prv.GeneratePublicKey()
  343. }
  344. }
  345. func BenchmarkBobKeyGenPubP503(b *testing.B) {
  346. prv := NewPrivateKey(FP_503, KeyVariant_SIDH_B)
  347. prv.Generate(rand.Reader)
  348. for n := 0; n < b.N; n++ {
  349. prv.GeneratePublicKey()
  350. }
  351. }
  352. func BenchmarkSharedSecretAliceP751(b *testing.B) {
  353. aPr := convToPrv(tdata[FP_751].PrA, KeyVariant_SIDH_A, FP_751)
  354. bPk := convToPub(tdata[FP_751].PkB, KeyVariant_SIDH_B, FP_751)
  355. for n := 0; n < b.N; n++ {
  356. DeriveSecret(aPr, bPk)
  357. }
  358. }
  359. func BenchmarkSharedSecretAliceP503(b *testing.B) {
  360. aPr := convToPrv(tdata[FP_503].PrA, KeyVariant_SIDH_A, FP_503)
  361. bPk := convToPub(tdata[FP_503].PkB, KeyVariant_SIDH_B, FP_503)
  362. for n := 0; n < b.N; n++ {
  363. DeriveSecret(aPr, bPk)
  364. }
  365. }
  366. func BenchmarkSharedSecretBobP751(b *testing.B) {
  367. // m_B = 3*randint(0,3^238)
  368. aPk := convToPub(tdata[FP_751].PkA, KeyVariant_SIDH_A, FP_751)
  369. bPr := convToPrv(tdata[FP_751].PrB, KeyVariant_SIDH_B, FP_751)
  370. for n := 0; n < b.N; n++ {
  371. DeriveSecret(bPr, aPk)
  372. }
  373. }
  374. func BenchmarkSharedSecretBobP503(b *testing.B) {
  375. // m_B = 3*randint(0,3^238)
  376. aPk := convToPub(tdata[FP_503].PkA, KeyVariant_SIDH_A, FP_503)
  377. bPr := convToPrv(tdata[FP_503].PrB, KeyVariant_SIDH_B, FP_503)
  378. for n := 0; n < b.N; n++ {
  379. DeriveSecret(bPr, aPk)
  380. }
  381. }