Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
7b749e6a
Commit
7b749e6a
authored
25 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Added wrappers for get_{d,p,q}().
Rev: lib/modules/Crypto/rsa.pike:1.21
parent
e1f62b55
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Crypto/rsa.pike
+52
-1
52 additions, 1 deletion
lib/modules/Crypto/rsa.pike
with
52 additions
and
1 deletion
lib/modules/Crypto/rsa.pike
+
52
−
1
View file @
7b749e6a
/* $Id: rsa.pike,v 1.2
0
2000/0
5/04 16:04:41
grubba Exp $
/* $Id: rsa.pike,v 1.2
1
2000/0
6/13 19:28:10
grubba Exp $
*
*
* Follow the PKCS#1 standard for padding and encryption.
* Follow the PKCS#1 standard for padding and encryption.
*/
*/
...
@@ -182,6 +182,42 @@ static class rsa_wrapper
...
@@ -182,6 +182,42 @@ static class rsa_wrapper
return res1;
return res1;
}
}
object get_d()
{
object res1 = _rsa_pike->get_d();
object res2 = BIGNUM(_rsa_c->cooked_get_d(), 256);
if (res1 != res2) {
werror("RSA: get_e() failed!\n");
error(sprintf("res1:%O != res2:%O\n", res1, res2));
}
return res1;
}
object get_p()
{
object res1 = _rsa_pike->get_p();
object res2 = BIGNUM(_rsa_c->cooked_get_p(), 256);
if (res1 != res2) {
werror("RSA: get_p() failed!\n");
error(sprintf("res1:%O != res2:%O\n", res1, res2));
}
return res1;
}
object get_q()
{
object res1 = _rsa_pike->get_q();
object res2 = BIGNUM(_rsa_c->cooked_get_q(), 256);
if (res1 != res2) {
werror("RSA: get_q() failed!\n");
error(sprintf("res1:%O != res2:%O\n", res1, res2));
}
return res1;
}
static void create()
static void create()
{
{
werror("RSA: Using rsa_wrapper\n");
werror("RSA: Using rsa_wrapper\n");
...
@@ -214,6 +250,21 @@ bignum get_e()
...
@@ -214,6 +250,21 @@ bignum get_e()
{
{
return BIGNUM(cooked_get_e(), 256);
return BIGNUM(cooked_get_e(), 256);
}
}
bignum get_d()
{
return BIGNUM(cooked_get_d(), 256);
}
bignum get_p()
{
return BIGNUM(cooked_get_p(), 256);
}
bignum get_q()
{
return BIGNUM(cooked_get_q(), 256);
}
#endif /* !USE_PIKE_RSA && !USE_RSA_WRAPPER && constant(_Crypto._rsa) */
#endif /* !USE_PIKE_RSA && !USE_RSA_WRAPPER && constant(_Crypto._rsa) */
object sign(string message, program h)
object sign(string message, program h)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment