Lines Matching defs:args
235 const FunctionCallbackInfo<Value>& args) {
236 Environment* env = Environment::GetCurrent(args);
237 DiffieHellman* diffieHellman = new DiffieHellman(env, args.This());
239 CHECK_EQ(args.Length(), 1);
240 THROW_AND_RETURN_IF_NOT_STRING(env, args[0], "Group name");
244 const node::Utf8Value group_name(env->isolate(), args[0]);
255 void DiffieHellman::New(const FunctionCallbackInfo<Value>& args) {
256 Environment* env = Environment::GetCurrent(args);
258 new DiffieHellman(env, args.This());
261 if (args.Length() == 2) {
262 if (args[0]->IsInt32()) {
263 if (args[1]->IsInt32()) {
264 initialized = diffieHellman->Init(args[0].As<Int32>()->Value(),
265 args[1].As<Int32>()->Value());
268 ArrayBufferOrViewContents<char> arg0(args[0]);
271 if (args[1]->IsInt32()) {
274 args[1].As<Int32>()->Value());
276 ArrayBufferOrViewContents<char> arg1(args[1]);
291 void DiffieHellman::GenerateKeys(const FunctionCallbackInfo<Value>& args) {
292 Environment* env = Environment::GetCurrent(args);
295 ASSIGN_OR_RETURN_UNWRAP(&diffieHellman, args.Holder());
320 args.GetReturnValue().Set(buffer);
324 void DiffieHellman::GetField(const FunctionCallbackInfo<Value>& args,
327 Environment* env = Environment::GetCurrent(args);
330 ASSIGN_OR_RETURN_UNWRAP(&dh, args.Holder());
352 args.GetReturnValue().Set(buffer);
355 void DiffieHellman::GetPrime(const FunctionCallbackInfo<Value>& args) {
356 GetField(args, [](const DH* dh) -> const BIGNUM* {
363 void DiffieHellman::GetGenerator(const FunctionCallbackInfo<Value>& args) {
364 GetField(args, [](const DH* dh) -> const BIGNUM* {
371 void DiffieHellman::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
372 GetField(args, [](const DH* dh) -> const BIGNUM* {
379 void DiffieHellman::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
380 GetField(args, [](const DH* dh) -> const BIGNUM* {
387 void DiffieHellman::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
388 Environment* env = Environment::GetCurrent(args);
391 ASSIGN_OR_RETURN_UNWRAP(&diffieHellman, args.Holder());
395 CHECK_EQ(args.Length(), 1);
396 ArrayBufferOrViewContents<unsigned char> key_buf(args[0]);
443 args.GetReturnValue().Set(buffer);
446 void DiffieHellman::SetKey(const FunctionCallbackInfo<Value>& args,
448 Environment* env = Environment::GetCurrent(args);
450 ASSIGN_OR_RETURN_UNWRAP(&dh, args.Holder());
451 CHECK_EQ(args.Length(), 1);
452 ArrayBufferOrViewContents<unsigned char> buf(args[0]);
460 void DiffieHellman::SetPublicKey(const FunctionCallbackInfo<Value>& args) {
461 SetKey(args,
466 void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo<Value>& args) {
467 SetKey(args,
472 void DiffieHellman::VerifyErrorGetter(const FunctionCallbackInfo<Value>& args) {
473 HandleScope scope(args.GetIsolate());
476 ASSIGN_OR_RETURN_UNWRAP(&diffieHellman, args.Holder());
478 args.GetReturnValue().Set(diffieHellman->verifyError_);
505 const FunctionCallbackInfo<Value>& args,
508 Environment* env = Environment::GetCurrent(args);
510 if (args[*offset]->IsString()) {
511 Utf8Value group_name(env->isolate(), args[*offset]);
522 if (args[*offset]->IsInt32()) {
523 int size = args[*offset].As<Int32>()->Value();
530 ArrayBufferOrViewContents<unsigned char> input(args[*offset]);
539 CHECK(args[*offset + 1]->IsInt32());
540 params->params.generator = args[*offset + 1].As<Int32>()->Value();
596 const FunctionCallbackInfo<Value>& args,
646 void DiffieHellman::Stateless(const FunctionCallbackInfo<Value>& args) {
647 Environment* env = Environment::GetCurrent(args);
649 CHECK(args[0]->IsObject() && args[1]->IsObject());
651 ASSIGN_OR_RETURN_UNWRAP(&our_key_object, args[0].As<Object>());
654 ASSIGN_OR_RETURN_UNWRAP(&their_key_object, args[1].As<Object>());
668 args.GetReturnValue().Set(out);
673 const FunctionCallbackInfo<Value>& args,
676 Environment* env = Environment::GetCurrent(args);
678 CHECK(args[offset]->IsObject()); // public key
679 CHECK(args[offset + 1]->IsObject()); // private key
684 ASSIGN_OR_RETURN_UNWRAP(&public_key, args[offset], Nothing<bool>());
685 ASSIGN_OR_RETURN_UNWRAP(&private_key, args[offset + 1], Nothing<bool>());