-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This one is a little more involved since this is the first curve where p != 3 mod 4, and in fact since P-224 is == 1 mod 16 we must use Shanks-Tonelli GH #4027
- Loading branch information
Showing
9 changed files
with
241 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<defines> | ||
PCURVES_SECP224R1 -> 20240716 | ||
</defines> | ||
|
||
<module_info> | ||
name -> "PCurve secp224r1" | ||
brief -> "secp224r1" | ||
type -> "Internal" | ||
</module_info> | ||
|
||
<requires> | ||
pcurves_impl | ||
</requires> |
42 changes: 42 additions & 0 deletions
42
src/lib/math/pcurves/pcurves_secp224r1/pcurves_secp224r1.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* (C) 2024 Jack Lloyd | ||
* | ||
* Botan is released under the Simplified BSD License (see license.txt) | ||
*/ | ||
|
||
#include <botan/internal/pcurves_instance.h> | ||
|
||
#include <botan/internal/pcurves_solinas.h> | ||
#include <botan/internal/pcurves_wrap.h> | ||
|
||
namespace Botan::PCurve { | ||
|
||
namespace { | ||
|
||
namespace secp224r1 { | ||
|
||
// TODO Secp224r1Rep | ||
|
||
// clang-format off | ||
class Params final : public EllipticCurveParameters< | ||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", | ||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", | ||
"B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", | ||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", | ||
"B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21", | ||
"BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"> { | ||
}; | ||
|
||
// clang-format on | ||
|
||
class Curve final : public EllipticCurve<Params> {}; | ||
|
||
} // namespace secp224r1 | ||
|
||
} // namespace | ||
|
||
std::shared_ptr<const PrimeOrderCurve> PCurveInstance::secp224r1() { | ||
return PrimeOrderCurveImpl<secp224r1::Curve>::instance(); | ||
} | ||
|
||
} // namespace Botan::PCurve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters