32 lines
450 B
Ruby
32 lines
450 B
Ruby
|
#!/usr/bin/ruby
|
||
|
# coding: utf-8
|
||
|
|
||
|
###################################
|
||
|
#
|
||
|
# Marcin Woźniak
|
||
|
# s434812
|
||
|
#
|
||
|
###################################
|
||
|
|
||
|
load '../module.rb'
|
||
|
load '../6/krzywa.rb'
|
||
|
|
||
|
def genKeysElGamalKrzywaEliptyczna
|
||
|
p = generate(300)
|
||
|
|
||
|
if primalityTest(p)
|
||
|
|
||
|
krzywa = generatorKrzywej(p)
|
||
|
a = krzywa[0].to_i
|
||
|
b = krzywa[1].to_i
|
||
|
|
||
|
while
|
||
|
|
||
|
# if x < ord = #E(Fp)
|
||
|
# x = SecureRandom.random_number(1..ord)
|
||
|
# end
|
||
|
|
||
|
|
||
|
end
|
||
|
end
|